ExtraStatic: powerful and easy publishing

Skip to content

Add view_source widget

Chris Dawson requested to merge add_source_widget into main

Add a view_source: true option to _config.yml.

If this is added, then you MUST add the <svekyll-source/> tag to your includes (Postroll.svelte, for example) to include a view source option. This will popup a dialog with the Svekyll source file for this post.

You can also access the source and build your own using this code in your template:

import { source } from '$svekyll/source.js';
const blogPostSource = $source[post.slug];

You can enable view source for just a particular file by adding view_source to the YAML front matter.

The view_source widget will alter latitude and longitude from attachments to anonymize them. This information might be in the YFM but not used in a post and should be kept private.

Screenshot_2024-03-08_at_4.03.35_PM

Screenshot_2024-03-08_at_4.03.47_PM

Edited by Chris Dawson

Merge request reports

Loading