Sha256: 030a516fca017bb06ce47c75bb0d3b0ce8870dadb1f498659ab5822b5efbf510
Contents?: true
Size: 579 Bytes
Versions: 20
Compression:
Stored size: 579 Bytes
Contents
# frozen_string_literal: true module Bridgetown module Publishable # Whether the resource is published or not, as indicated in YAML front-matter def published? !(data.key?("published") && data["published"] == false) end def publishable? return true if collection.data? return false unless published? || @site.config.unpublished future_allowed = collection.metadata.future || @site.config.future this_time = date.is_a?(Date) ? date.to_time.to_i : date.to_i future_allowed || this_time <= @site.time.to_i end end end
Version data entries
20 entries across 20 versions & 1 rubygems