Menu icon Foundation
Did you know? Pages »last modified« date/time

Did you know?

At least Foundation 6.3.1 (SASS), upon generating the compiled »dist« version, will set the generated page’s last modified date to the date the actual page was last modified (in pages folder), even if you modify an included partial!

 

Why is this good?

  • The generated page’s date & time (and eventually any sitemaps and search engines) hopefully reflect the date & time the content was last changed.
  • Not each and every file is flagged »new« when re-generating.

 

Why is this bad?

  • If you use the actual page more like a template (say, for a blog where the content comes from its partials), it will still show the old date.
  • Auto-generated sitemaps and thus search engines might not (immediately) recognize the new content since they still see the old »last modified« date.
  • If you use »older« deploying mechanisms like FTP with an option like »overwrite only if newer«, some files might not even be updated on your live production site. (You can circumvent this by using an option like »overwrite if newer or size changed«.)

 

How do you feel about this design decision?

FoundationSassnpmgulppages

Did you know?

At least Foundation 6.3.1 (SASS), upon generating the compiled »dist« version, will set the generated page’s last modified date to the date the actual page was last modified (in pages folder), even if you modify an included partial!

 

Why is this good?

  • The generated page’s date & time (and eventually any sitemaps and search engines) hopefully reflect the date & time the content was last changed.
  • Not each and every file is flagged »new« when re-generating.

 

Why is this bad?

  • If you use the actual page more like a template (say, for a blog where the content comes from its partials), it will still show the old date.
  • Auto-generated sitemaps and thus search engines might not (immediately) recognize the new content since they still see the old »last modified« date.
  • If you use »older« deploying mechanisms like FTP with an option like »overwrite only if newer«, some files might not even be updated on your live production site. (You can circumvent this by using an option like »overwrite if newer or size changed«.)

 

How do you feel about this design decision?

Rafi Benkual 2 months ago

Hmm, seems to make sense to me that it works this way. It's interesting that content is being changed in a partial rather than creating new pages. I usually create new page for content and layouts as the template.

One idea is to add some type of Panini helper to update the publish date in the page template anytime new partials are updated.

Matthias Hormann 2 months ago

Hey Rafi, good to see you respond.

It was actually not critique, because I’m still a little unsure myself what would be the best way to handle these cases. I just thought I’d mention it since people might just not know.

I myself ran across it lately when changing my »navigation« partial which gets included via »layouts/default.hmtl« and the generated pages wouldn’t change date/time.

I also use heavily parametrized pages, for instance the German privacy/data protection laws are a nightmare, so I use a »data/v.yml« file to specify which to use, like so:

# DATENSCHUTZ (Privacy)
# Select the services you use by setting their "use: true", respectively
# For some modules, you might have to fill in additional parameters,
# i.e. google-analytics.
privacy:
  modules:

    allgemein:
      use: true
      partial: datenschutz-allgemein
      heading: Datenschutz

    cookies:
      use: true
      partial: datenschutz-cookies
      heading: Cookies

    google-analytics:
      use: false
      partial: datenschutz-google-analytics
      heading: Datenschutzerklärung für die Nutzung von Google Analytics

      trackingID: UA-XXXXX-Y
      cookieDomain: auto
      name:
      hitType: pageview

      browser-plugin:
        use: true
        heading: Browser Plugin
      optoutcookie:
        use: true
        heading: Widerspruch gegen Datenerfassung
      auftragsdatenverarbeitung:
        use: false
        heading: Auftragsdatenverarbeitung
      ip-anonymisierung:
        use: true
        heading: IP-Anonymisierung

and in the actual »datenschutz« (privacy) page include them like this (each type has its own legal text in a separate partial):

<div class="row content">
  {{#each v.privacy.modules}}
    {{#if this.use}}
      <section class="small-12 columns">
        <h3>{{this.heading}}</h3>

        {{> (lookup . 'partial')}}
      </section>
    {{/if}}
  {{/each}}
  <section class="small-12 columns">
    <p><small><em>Quellen: <a href="…" rel="nofollow" target="_blank">…</a> u.a.</em></small></p>
  </section>
</div>

Just to show an example :-)