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

feat: use Eleventy localization features and Eleventy asset processing #337

Merged
merged 53 commits into from
Aug 10, 2023
Merged

feat: use Eleventy localization features and Eleventy asset processing #337

merged 53 commits into from
Aug 10, 2023

Conversation

greatislander
Copy link
Contributor

@greatislander greatislander commented Jul 28, 2023

  • This pull request has been linted by running npm run lint without errors
  • This pull request has been tested by running npm run start and reviewing affected routes
  • This pull request has been built by running npm run build without errors
  • This isn't a duplicate of an existing pull request

Description

This PR:

  1. Adopts first-party Eleventy localization features and eleventy-plugin-i18n-gettext for string translation.
  2. Adopts eleventy-plugin-fluid for asset processing, removing Laravel Mix and Stylus support.
  3. Updates other dependencies.
  4. Simplifies Eleventy configuration to use default _site directory for build output.
  5. Prefixes build helper directories in src with an underscore (_filters, _locales, _shortcodes, _transforms, _utils) to match Eleventy conventions (see: https://www.11ty.dev/docs/config/#directory-for-includes, https://www.11ty.dev/docs/config/#directory-for-layouts-(optional)).
  6. Moves to separate configurations for linters, and adds lint-staged, rather than running fluid-lint-all.
  7. Adds the Netlify Identity widget to the home page for quicker setup with Netlify Identity and Decap CMS.

Steps to test

Basic behaviour

  1. Run npm run start
  2. Visit site at http://localhost:8080 and test navigation between French and English content.

Expected behavior: Content available in French and English is linked properly.

Adding a language

  1. Follow steps here
  2. Run npm run start

Expected behavior: Build functions without errors. Content available in French, English, and the newly added language is linked properly. RSS feed, 404 page, and posts pages are available in the newly added language. CMS functions as expected.

Disabling localization for posts

  1. Follow steps here.
  2. Run npm run start

Expected behavior: Build functions without errors. Content available in French, and English is linked properly. RSS feed is only available in the default language and posts pages in both languages show default language content. CMS functions as expected.

Disabling localization for full site

  1. Follow steps here.
  2. Run npm run start

Expected behavior: Build functions without errors. Content is only shown in English. RSS feed, posts page and 404 pages are only available in the default language. CMS functions as expected.

Additional information

Not applicable.

Related issues

Not applicable.

feat: add gettext support for translations
feat: use eleventy-plugin-fluid to process assets
feat!: drop Stylus support
@greatislander greatislander added enhancement New feature or request dependencies Pull requests that update a dependency file labels Jul 28, 2023
@greatislander greatislander added this to the 2.0.0 milestone Jul 28, 2023
@greatislander greatislander self-assigned this Jul 28, 2023
@greatislander greatislander marked this pull request as ready for review July 28, 2023 19:04
@greatislander greatislander enabled auto-merge (squash) July 28, 2023 19:05
@greatislander greatislander marked this pull request as draft July 31, 2023 12:33
auto-merge was automatically disabled July 31, 2023 12:33

Pull request was converted to draft

@greatislander greatislander marked this pull request as ready for review July 31, 2023 13:02
@greatislander greatislander enabled auto-merge (squash) July 31, 2023 13:03
@greatislander greatislander enabled auto-merge (squash) July 31, 2023 13:12
src/collections/pages/fr-CA/fr-CA.11tydata.js Outdated Show resolved Hide resolved
src/feed.njk Outdated Show resolved Hide resolved
src/utils/generatePermalink.js Outdated Show resolved Hide resolved
src/collections/pages/pages.11tydata.js Outdated Show resolved Hide resolved
Copy link
Member

@jobara jobara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good so far. Is it just the docs that we're waiting on, or was there something else you'd like to add as well?

@greatislander
Copy link
Contributor Author

Looking good so far. Is it just the docs that we're waiting on, or was there something else you'd like to add as well?

I'll move the utility into eleventy-plugin-fluid, get your review on that, then update this PR to depend on that.

@greatislander greatislander changed the title feat: use Eleventy localization features feat: use Eleventy localization features and Eleventy asset processing Aug 2, 2023
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@greatislander greatislander enabled auto-merge (squash) August 8, 2023 11:51
Copy link
Member

@jobara jobara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In running through the steps for "Disabling Internationalization for the Entire Site", using either method from step 4, the site is generated without navigation.

Screenshot showing that site navigation is missing

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Co-authored-by: Justin Obara <jobara@users.noreply.github.com>
@greatislander greatislander merged commit 610868d into fluid-project:main Aug 10, 2023
7 checks passed
@greatislander greatislander deleted the feat/native-localization branch August 10, 2023 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request
Projects
None yet
3 participants