Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Include _data from theme in sites that use the theme #68

Closed
hblankenship opened this issue Jan 20, 2020 · 3 comments
Closed

Feature: Include _data from theme in sites that use the theme #68

hblankenship opened this issue Jan 20, 2020 · 3 comments

Comments

@hblankenship
Copy link

Not being able to have the _data/ collections in a remote theme be accessible to sites that use the theme is problematic.

There are useful collections that one might consider putting in a remote theme and using across many repositories (the owasp foundation website https://owasp.org is a collection of repositories making up one website). Such data might include a default menu system for all sites that resides in the header or a default set of corporate supporters to display in a footer.

I propose that any collection that exists in a _data folder in the remote theme be accessible via sites that use the theme. Further, in case of name collisions, if the site implementing the remote theme uses a data collection of the same name then the remote theme's version of the collection is replaced by the site's version. This functionality is available in a ruby gem for gem themes and would be useful here.

Currently the alternative to this is to put data in a separate folder in a json file and load the json file via javascript in the remote theme. This workaround assumes the use of javascript and we would like to avoid requiring js.

@delisma
Copy link

delisma commented Jan 29, 2020

This feature could be useful for i18n and/or l10n, when building multilingual theme and the 118n strings sits in _data folder. In case of conflicts the files in _data can always be overridden like the _includes and _laytouts folders are.

@stale
Copy link

stale bot commented Mar 29, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 29, 2020
@stale stale bot closed this as completed Apr 5, 2020
DaveThw added a commit to DaveThw/davethw.github.io that referenced this issue May 7, 2020
It seems that remote themes don't pull files from the remote _data folder
(see benbalter/jekyll-remote-theme#68) - therefore
site.data.ui-text is missing.  Most of the MM theme falls back (to English),
but a few things don't - for example, the "Follow:" text in the page footer...
@mgerzabek
Copy link

mgerzabek commented Mar 11, 2021

In these days we have hundreds of tracking services, marketing automation services, form frameworks, etc. that all require a couple of paragraphs in a GDPR statement. It’s the obligation of a consumer project to gather these semi-legal pieces of information and to put them into a privacy statement.

Instead of putting these text modules into a privacy page itself I propose to put them into a catalogue in the data folder of a theme.

This way a kind of micro MVC pattern could be implemented by offering a specialized layout in combination with a page that extends this layout. The data file would become the model, the layout the view and the page on the consumer project the controller.

As @benbalter tagged this issue to be a good first issue I implemented the additions to his plugin in #89 and an implementation of the pattern in my first remote theme https://github.com/storyfaktor/klartext.

model: _data/datenschutz.json
view: _layouts/datenschutz.html

controller: Any page which utilizes the layout from the remote_theme. In the frontmatter boolean switches control which text modules get included in rendering.

Reviews welcomed.

GitHub
Ein Jekyll Theme für EPUs, Brainworker (Berater, Trainer und Coaches), Content Marketer, Autoren, Wissenschafter und Schreibwütige. - storyfaktor/klartext

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants