Make a Static Site Citable: ORCID, DOIs, Citation Metadata

A personal site can behave like a journal: register an ORCID, apply to Rogue Scholar for DOIs, add citation meta tags and cite buttons, write print CSS, and archive every page to the Wayback Machine. The code is for Eleventy.

By
Brennan Kenneth Brown
Published
Reading time
8 minutes
Level
Advanced
You need
  • An Eleventy site, or willingness to adapt the ideas to another generator
  • Comfort with Nunjucks templates and Node.js scripts
Northern Renaissance painting of an elderly scholar in a red robe at a cluttered desk, pointing at a skull
Saint Jerome in His Study' by Pieter Coecke van Aelst the elder. ca. 1530 | The Walters Art Museum (edited by the Author)

This guide shows how to make a static website citable like a journal: register an ORCID, apply to Rogue Scholar for DOIs and archive mirroring, add issue numbers and ISSN metadata, generate citation exports, mark up pages with Highwire Press and Dublin Core tags, publish a metadata-rich RSS feed, write print CSS, and mirror the site to the Wayback Machine.

A journal's article page offers four things a typical blog does not: citability, discoverability, authorship and permanence. The steps below add each of them to an Eleventy site, using the code from brennan.day.

How do I apply to Rogue Scholar for DOIs?

The first step is applying to Rogue Scholar, an open-access archive that creates DOIs for science and scholarly blog posts, and mirrors them into the Internet Archive. It's run by Front Matter, and it's free, unlike Crossref membership, which costs $200 USD a year. I've applied, and I'm currently looking for an institutional sponsor (such as Coalition Publica) to cover a Crossref membership down the line.

How do I register an ORCID?

Register an ORCID, a universal author ID for academia. Researchers use it to disambiguate themselves from others who share their name, and it's a persistent identifier across institutions, journals, and platforms. Mine is 0009-0004-9951-3451, and I've wired it into my site: rel="me" on my accounts page, the h-card on every post byline, and a handful of citation and structured data fields I'll get into below.

How do I add journal-like metadata and features to an Eleventy site?

The identifiers above only matter if the site has the front matter, scripts and elements that make it citable. These are the pieces I added:

An Issue Numbering System

Journals have issues. Every article belongs to one, with a number, so citations can say "Vol. 4, No. 12" in addition to the URL. I don't publish in discrete issues due to my publishing frequency, so I made every single post its own issue. Post #1 is issue #1, post #212 is issue #212, and so on.

I created an Eleventy filter for this. collections.posts sorts by newest-first by default, so the oldest post (at the end of the array) is issue #1:

// config/filters.js
eleventyConfig.addFilter("getIssueNumber", (collection, page) => {
  if (!collection || !page || !page.url) return "";
  const index = collection.findIndex(item => item.url === page.url);
  if (index === -1) return "";
  // collection is sorted newest-first, so the oldest item is issue #1
  return collection.length - index;
});

Because this number is computed from the current length of the collection, unpublishing or deleting a post would shift every later number. For a system whose goal is permanence and citability, that is fragile. The long-term fix is to assign an issue field in each post's frontmatter and have the filter fall back to that. I have not migrated the archive yet, so the current numbers are best-effort.

Then in src/_includes/layouts/post.njk, the issue number is displayed under the featured image caption, in small caps, above the title:

<p class="publication-issue"><span class="sc">issue #{{ collections.posts | getIssueNumber(page) }} of {{ site.title }}</span></p>
<h1 class="p-name" data-pagefind-meta="title">{{ title }}</h1>

.sc is a one-line utility class I already had (font-variant: small-caps;), so no new CSS needed.

ISSN Metadata

An ISSN (International Standard Serial Number) is a unique 8-digit code used to identify continuing publications like magazines, journals, newspapers, and websites. It helps libraries, stores, and databases quickly find and sort specific serial titles without mixing them up.

In Canada, you can apply for an ISSN free of charge.

I just applied, so I don't have an assigned ISSN yet. The ISSN eligibility rules may mean that my publication is ineligible, but I think the site has sufficient merit.

The field for an ISSN is set up, with the value saved in src/_data/site.json.

{% if site.issn %}<meta name="citation_issn" content="{{ site.issn }}">{% endif %}

It'll propagate to the citation meta tags, the JSON-LD, the RSS feed's <category domain="ISSN">, and both the about page and colophon, without touching a single template again.

Publication Information Dropdown

Below the fold of every post, there's now a <details> element with what you'd find on a journal's article page: title, author with ORCID link, issue number, ISSN (once assigned), published and modified dates, canonical URL, place of publication, and contact:

<details class="cite-article h-cite">
  <summary>Publication Information</summary>
  <p><strong>Title:</strong> <span class="p-name">{{ title }}</span></p>
  <p><strong>Author:</strong> <span class="p-author p-name">{{ site.author.name }}</span>
    {% if site.author.orcid %} <a class="u-uid" href="{{ site.author.orcid }}" rel="me">ORCID</a>{% endif %}</p>
  <p><strong>Issue:</strong> #{{ collections.posts | getIssueNumber(page) }} of {{ site.title }}</p>
  {% if site.issn %}<p><strong>ISSN:</strong> <span class="p-issn">{{ site.issn }}</span></p>{% endif %}
  <p><strong>Date Published:</strong> <time class="dt-published" datetime="{{ date | isoDate }}">{{ date | readableDate }}</time></p>
  ...
</details>

It's marked up with h-cite microformats so, in theory, other IndieWeb tools parsing my posts can pull structured citation data out of it the same way they'd parse an h-entry.

A "Cite This Issue" Button

Right below that, I added a second <details> block that provides one-click citation exports. Click it open and you get MLA 9, APA 7, Chicago notes-bibliography, and BibTeX, all pre-filled with the post's frontmatter:

<details class="cite-export">
  <summary>Cite this issue</summary>
  <ul class="citation-formats">
    <li>
      <strong>MLA 9</strong>
      <pre>{{ site.author.name }}. "{{ title }}." {{ site.title }}, {{ date | readableDate }}, {{ site.url }}{{ page.url }}.</pre>
    </li>
    <li>
      <strong>BibTeX</strong>
      <pre>@online{brennan{{ year }}{{ page.url | slugify }},
  author = {{ '{' }}{{ '{' }}{{ site.author.name }}{{ '}' }}{{ '}' }},
  title = {{ '{' }}{{ title }}{{ '}' }},
  year = {{ '{' }}{{ year }}{{ '}' }},
  url = {{ '{' }}{{ site.url }}{{ page.url }}{{ '}' }},
  urldate = {{ '{' }}{{ buildTime | htmlDateString }}{{ '}' }}
}</pre>
    </li>
    <!-- APA, Chicago follow the same pattern -->
  </ul>
</details>

The BibTeX block writes literal curly braces through Nunjucks expressions because Nunjucks and BibTeX both use them. It is clumsy, but it works.

Citation Meta Tags and Dublin Core

Google Scholar, Zotero, and most citation managers look for a specific, decades-old convention called Highwire Press tags, prefixed citation_*. I added a full set to every post's <head> in src/_includes/partials/meta.njk:

<meta name="citation_title" content="{{ title }}">
<meta name="citation_author" content="{{ site.author.name }}">
<meta name="citation_publication_date" content="{{ date | isoDate | split('T') | first | replace('-', '/') }}">
<meta name="citation_journal_title" content="{{ site.title }}">
{% if site.issn %}<meta name="citation_issn" content="{{ site.issn }}">{% endif %}
<meta name="citation_issue" content="{{ collections.posts | getIssueNumber(page) }}">
{% if site.author.orcid %}<meta name="citation_author_orcid" content="{{ site.author.orcid }}">{% endif %}

Right below that, I added the Dublin Core set, which is the older, broader library-science metadata standard that many archives and repositories still use: DC.Title, DC.Creator, DC.Publisher, DC.Date, DC.Identifier, DC.Rights, and so on.

The Article block in my JSON-LD (src/_includes/partials/structured-data.njk) has the same info, an issueNumber field, and a conditional identifier object with propertyID: "ISSN":

{
  "@type": "Article",
  "issueNumber": "{{ collections.posts | getIssueNumber(page) }}",
  "identifier": {
    "@type": "PropertyValue",
    "propertyID": "ISSN",
    "value": "{{ site.issn }}"
  }
}

The RSS Feed

Rogue Scholar (and basically every serious feed reader) parses your RSS feed, not your HTML, so the feed needed the same metadata as the posts themselves. src/feed.njk got a dc namespace and a content namespace added to the root <rss> element, then per-item tags for creator, date, language, identifier, source, and rights:

<item>
  <guid isPermaLink="true">{{ absolutePostUrl }}</guid>
  <dc:creator>{{ site.author.name }}</dc:creator>
  <dc:date>{{ post.data.date | isoDate }}</dc:date>
  <dc:rights>https://creativecommons.org/licenses/by-sa/4.0/</dc:rights>
  {% if site.issn %}<category domain="ISSN">{{ site.issn }}</category>{% endif %}
  ...
</item>

At the channel level, I added an <atom:author> block pointing at my ORCID as the author URI, a <copyright> line, and a channel <image>. This makes the feed declare who is responsible for the content and under what terms it can be reused.

This piece is not about metadata. Printing a post with Ctrl/Cmd + P now gives a styled output that looks closer to a printed publication, using only CSS.

One of the tricks is page-break-before and flex-direction: column with the order property, so I can rearrange the DOM for print without needing to modify the markup itself:

@media print {
  .h-entry {
    display: flex;
    flex-direction: column;
  }

  /* Title / cover page */
  .post-single .post-header {
    order: 1;
    text-align: center;
    padding-top: 15vh;
  }

  /* Featured image, still on the cover page */
  .featured-image {
    order: 2;
    page-break-inside: avoid;
  }

  /* A dedicated masthead page, after the cover */
  .print-masthead {
    display: block;
    order: 3;
    page-break-before: always;
    page-break-after: always;
  }

  /* The actual essay */
  .e-content {
    order: 4;
  }
}

That .print-masthead div is invisible on screen (display: none outside of @media print) and only appears when you print, as its own page, listing the issue number, publisher, place of publication, and contact:

<div class="print-masthead">
  <p class="sc">{{ site.title }} — issue #{{ collections.posts | getIssueNumber(page) }}</p>
  <p>Publisher: {{ site.author.name }}</p>
  <p>Place of publication: {{ site.author.location.city }}, {{ site.author.location.region }}, {{ site.author.location.country }}</p>
  <p>Available at: {{ site.url }}</p>
  <p>Contact: {{ site.author.email }}</p>
</div>

I also added the featured image's caption date and URL onto the page as a ::after pseudo-element (content: attr(data-date) "\A" attr(data-url);), added drop-cap-style paragraph indentation for body text after the first one, and widow and orphan control (widows: 2; orphans: 2;).

There are many other elements on my site that don't make sense to print, so those aren't displayed:

.site-header, .sidebar, .site-footer,
nav, .breadcrumbs, .post-meta,
.post-tags, .post-footer, .post-nav,
.like-form, .newsletter-signup, .comments-section,
.webmentions, .related-posts-list, .toc,
.reply-context, .external-link-notice, .cite-article,
noscript, script, iframe {
  display: none !important;
}

On screen, paragraphs are separated by margin, but in print I wanted no gap between paragraphs, and the second paragraph onward gets a first-line indent instead:

.e-content p {
  margin: 0;
}

.e-content p + p {
  text-indent: 1.5em;
}

And since a browser's print renderer doesn't know or care about clean page breaks, I explicitly declare which elements are allowed to split across pages and which aren't:

pre, blockquote, img,
figure, table {
  page-break-inside: avoid;
}

h1, h2, h3 {
  page-break-after: avoid;
}

These rules stop a heading being stranded at the bottom of a page and keep figures from splitting across pages.

Archiving to the Wayback Machine

Permanence needs more than metadata in the page head: citation tags and DOIs do not help if the page itself disappears. Rogue Scholar solves this for the posts it ingests, since it holds its own Archive-It subscription that backs up everything it archives.

I wanted the same backup for my entire site, so I wrote scripts/archive-to-wayback.js.

The script reads every URL out of my live sitemap.xml and submits each one to the Internet Archive's Save Page Now API, which snapshots the page into the Wayback Machine:

async function fetchSitemapUrls(sitemapUrl) {
  const res = await fetchWithTimeout(sitemapUrl, {}, 30_000);
  const xml = await res.text();
  const urls = [...xml.matchAll(/<loc>\s*([^<\s]+)\s*<\/loc>/g)].map((m) => m[1]);
  return [...new Set(urls)];
}

With 400+ pages on the site now, it needs to survive being interrupted, and it needs to not get rate-limited off the API.

So it's resumable by default. Every result gets written to .cache/wayback-archive/progress.json immediately after each URL, keyed by the URL itself. Re-running it skips whatever's already marked saved:

const pending = urls.filter((url) => !progress.results[url] || progress.results[url].status === 'failed');

Archive.org's anonymous Save Page Now limit is roughly three requests a minute, so my script waits 20 seconds between each one to stay under that. You can get a free S3-style key pair from archive.org, and that enables the script to send authenticated requests instead, which are more reliable:

if (AUTHENTICATED) {
  headers.Authorization = `LOW ${ACCESS_KEY}:${SECRET_KEY}`;
}

A single failed request retries with backoff up to three times. But if five requests in a row fail, then that's probably archive.org having an outage, which sadly happens:

if (consecutiveFailures >= OUTAGE_STREAK_THRESHOLD) {
  saveProgress(progress);
  await sleep(OUTAGE_BACKOFF_MS);
  consecutiveFailures = 0;
  continue; // retry the same URL, don't advance i or record a failure
}

The script also stops after three hours, rather than running indefinitely in the background to limit load on Archive.org's servers; it can be started again and resumes where it stopped.

What About Peer Review?

This setup does not replicate expert peer review. A journal article is a durable object with metadata that has also been evaluated by people who know the field.

ORCID, DOIs, ISSNs, and Highwire Press tags make a post discoverable and citable, but they do not make it reviewed.

This set up is designed for post-publication, open review. My posts have a public URL, a permanent archive, and a comment section. I am reachable by email and on the fediverse. I can issue corrections or new versions transparently. Webmentions and GitLab issues can become a record of response and critique, and I can invite named readers or mentors to comment on specific essays before or after they go live.

None of that is comparable to a double-blind peer review. I would rather a reader evaluate the argument themselves, check the sources, and cite it with the stated limitation: this is an independent scholarly contribution, not a peer-reviewed journal article.

Beyond this set up, I'd recommend platforms like PubPub, Humanities Commons, Zenodo, the Open Science Framework, Knowledge Commons, and the Open Journal Systems software.

Summary

You can do all of this without an institution. An ISSN application in Canada is free to attempt, an ORCID takes a few minutes to register, Rogue Scholar is free, and the citation meta tags are copy-paste. The source for everything above is on GitLab.