Commit Graph

76 Commits

Author SHA1 Message Date
Sped0n
268159e7d2 refactor: unify bundled assets with subdirs and Hugo mounts
Move bundled outputs to dedicated css/js subdirs. Update Vite
config to output directly to bundled/ with simplified naming.
Add Hugo module mounts to expose as assets/bundled and
static/bundled. Adjust gitignore and partial accordingly.

Signed-off-by: Sped0n <hi@sped0n.com>
2025-11-14 18:15:24 +08:00
Sped0n
4b1f529589 refactor: migrate to vite for critical scss bundling, remove dart sass dependency
Signed-off-by: Sped0n <hi@sped0n.com>
2025-11-12 17:14:20 +08:00
Sped0n
48eaa9d95b docs: restructure documentation
Signed-off-by: Sped0n <hi@sped0n.com>
2025-11-12 02:40:38 +08:00
Sped0n
ba0def753e refactor: remove i18n labels and centralize in config
Delete multilingual i18n files for UI labels. Add English labels to
params.toml under [labels]. Update 404.html, single.html, and nav.html
to use site.Params.labels instead of i18n.

Signed-off-by: Sped0n <hi@sped0n.com>
2025-11-12 00:27:13 +08:00
Sped0n
7d4bed3ba6 feat: use absolute URLs for assets
closes #473, closes #476

Signed-off-by: Sped0n <hi@sped0n.com>
2025-11-12 00:10:06 +08:00
Sped0n
72b830def9 refactor: remove multilingual support and language-specific fonts
Simplify to Geist font family for all languages. Update README, SCSS,
partials, and config. Fix style template execution order.

Signed-off-by: Sped0n <hi@sped0n.com>
2025-11-12 00:10:06 +08:00
Ryan
36721f8bf6 Bump deps (#515)
* chore: add nix flake for reproducible dev environment

Signed-off-by: Sped0n <hi@sped0n.com>

* refactor: migrate SCSS to modern Sass (@use/@forward)

Update mixins to use Sass module functions (map.has-key/get).
Configure Vite for modern Sass API.
Introduce _foundation.scss for forwarding core modules.

Signed-off-by: Sped0n <hi@sped0n.com>

* fix: replace deprecated _build with build in frontmatter

Signed-off-by: Sped0n <hi@sped0n.com>

* chore: add vcache.sh script for vercel build cache management

Signed-off-by: Sped0n <hi@sped0n.com>

* refactor: migrate to ESLint v9 flat config

Remove legacy .eslintrc.json, .eslintignore, and .prettierrc.json.

Add eslint.config.mjs with love, prettier, solid, and import rules.

Update devDependencies (eslint@9, @typescript-eslint@8, etc.) and scripts.

Minor TS fixes: remove eslint-disable, add error logging, simplify conditional.

Signed-off-by: Sped0n <hi@sped0n.com>

* chore: replace vcache.sh with vercel.sh for Vercel build process

Delete vcache.sh script.

Add vercel.sh: install Dart Sass v1.93.3, copy generated assets between
node_modules and project dirs, run vite:build + hugo build, then copy back.

Signed-off-by: Sped0n <hi@sped0n.com>

* chore: setup dart-sass and split build steps in GitHub workflow

Signed-off-by: Sped0n <hi@sped0n.com>

---------

Signed-off-by: Sped0n <hi@sped0n.com>
2025-11-11 20:20:29 +08:00
Ananth
9016cfb035 Add tamil translation (#430) 2025-01-03 16:19:41 +08:00
Spedon
875113448b refactor: migrate part of the sass compilation to vite (#283)
* refactor: migrate part of the sass compilation to vite

now `bundled` option is deprecated

* fix: update build script

* chore: add a “type” field to the package.json file to resolve Vite’s complaints about CommonJS modules.
2024-02-22 23:44:16 +08:00
Spedon
ba07636f8f refactor: prefine for version v1.0.2 (#269)
* refactor: refactor navigateVector logic and remove unused functions

* refactor: refactor HTML structure and styling in single.html

- Modify the `.info` class to `article` in `_article.scss`
- Remove the `nav.html` partial in `single.html`
- Change the class name from `info` to `article` in `single.html`
- Add the `nav.html` partial in `single.html`

* refactor: update handling of 404 page
- Now hugo will set unknown page title as "404"
- Add condition to return an empty image array if the document title starts with "404"

* docs: update documentation
2024-02-05 16:02:10 +08:00
Spedon
1f65b08b56 refactor: refactor the pile of crap I wrote before 🤡 (#259)
* feat: refactor file structure and imports in mobile and desktop components

- Removed the import of `scrollable` from `assets/ts/mobile/scroll.ts`
- Renamed `assets/ts/mobile/mounted.ts` to `assets/ts/mobile/state.ts`
- Changed the import of `active` from `./stage` to `./state` in `assets/ts/desktop/customCursor.ts`
- Changed the import of `active` from `../state` to `../globalState` in `assets/ts/desktop/stage.ts`
- Changed the import of `active` from `./stage` to `./state` in `assets/ts/desktop/stageNav.ts`
- Renamed `assets/ts/state.ts` to `assets/ts/globalState.ts`
- Created a new file `assets/ts/desktop/state.ts`
- Added the interface `HistoryItem` to `assets/ts/desktop/state.ts`
- Added the variables `cordHist`, `isOpen`, `active`, and `isLoading` to `assets/ts/desktop/state.ts`
- Deleted the function `loader` from `assets/ts/desktop/stage.ts` and replaced it with `setLoaderForImage`
- Deleted the import of `./stage` from `assets/ts/desktop/stageNav.ts`
- Added the import of `minimizeImage` from `./stage` in `assets/ts/desktop/stageNav.ts`
- Deleted the import of `./mounted` from `assets/ts/mobile/collection.ts`
- Changed the import of `mounted` from `./mounted` to `./state` in `

* refactor: refactor the `onVisible` function to improve performance

- Modify the type of the `onVisible` function parameter `T` to extend `HTMLElement`
- Change the `entries.forEach` loop in the `onVisible` function to `entries.every`

* feat: add new function for detecting opacity changes in element

- Add a new function `onOpacityOne` in `assets/ts/utils.ts`
- The function uses a `MutationObserver` to check for opacity changes on an element
- When the element's opacity reaches `1`, the provided callback function is called
- The `MutationObserver` is disconnected after the callback is executed

* refactor: refactor function names and parameters in intersection and mutation observers

- Change the function name `onVisible` to `onIntersection`
- Modify the `callback` parameter in the `onIntersection` function to accept `IntersectionObserverEntry[]` and `IntersectionObserver` parameters
- Remove the code block that checks for intersection ratio and immediately calls the `callback` function in the `onIntersection` function
- Modify the function name `onOpacityOne` to `onMutation`
- Modify the `callback` parameter in the `onMutation` function to accept `MutationRecord[]` and `MutationObserver` parameters
- Add a default value for the `observeOptions` parameter in the `onMutation` function

* refactor: refine preload logic on both mobile and desktop

* refactor: refactor import statements and add new files

- The import statement for `Watchable` in `assets/ts/globalState.ts` has been changed from `../utils` to `../globalUtils`
- The import statement for `Watchable` in `assets/ts/desktop/state.ts` has been changed from `../utils` to `../globalUtils`
- The import statement for `decrement` and `increment` in `assets/ts/desktop/stageNav.ts` has been changed from `../utils` to `../globalUtils`
- A new file `utils.ts` has been added in the `assets/ts/desktop` directory
- The import statements for `getRandom`, `onIntersection`, and `type MobileImage` in `assets/ts/mobile/collection.ts` have been changed from `../utils` to `./utils`
- The `imgs` array in `assets/ts/mobile/collection.ts` has been changed from an array of `HTMLImageElement` to an array of `MobileImage`
- The import statements for `expand`, `loadGsap`, `loadSwiper`, and `removeDuplicates` in `assets/ts/mobile/gallery.ts` have been changed from `../utils` to `../globalUtils`
- The import statement for `type MobileImage` in `assets/ts/mobile/gallery.ts` has been changed from `./utils` to `../mobile/utils`
- The `galleryLoadImages` function in `assets/ts/mobile/gallery.ts` has been removed
- A new file `utils.ts`

* refactor: refactor swiper import and functions in mobile and global utils

* refactor: refactor navigation and image loading logic in desktop and mobile

* refactor: remove print function and optimize removeDuplicates return

* refactor: update text variable assignments and attributes

* refactor: update variable types in galleryImages and collectionImages in mobile/gallery.ts

* refactor: refactor variable types for consistency with naming conventions

* refactor: update animation durations and types in gallery functions

* refactor: refactor image loading logic and add console logs

* refactor: refactor sass hierarchy

* refactor: remove console logs in multiple files
2024-02-03 23:17:16 +08:00
Spedon
2fd34c2f7f refactor: replace svh with a more compatible approach (#252)
* first attempt

* second attempt

* blind commit
2024-01-23 00:06:42 +08:00
Spedon
49e9f904e2 fix: fix article regresssion (#250)
* refactor: output article element when needed

* refactor: refactor container styles and media queries

- Add the `$tablet` variable to `_container.scss`
- Add a media query to `_container.scss`
- Import `_container.scss` in `critical.scss`
- Remove the import of `_container.scss` in `style.scss`
2024-01-22 20:35:15 +08:00
Spedon
9fa1b718b8 feat: add loading indicator for desktop and mobile (#244)
* feat: add new CSS rule for hiding elements

- Add a new CSS rule for the class "hide" with a display property set to "none".

* feat: refactor image loading and navigation logic on desktop

- Add a line of code in `assets/ts/desktop/stage.ts` to reset the `src` of `elc` and add a class `hide` to it
- Add a line of code in `assets/ts/desktop/stage.ts` to call the `loader` function with `elc` as an argument
- Add a function `loader` in `assets/ts/desktop/stage.ts` to handle image loading and error events
- Modify the `initStageNav` function in `assets/ts/desktop/stageNav.ts` to watch the `isLoading` state and set custom cursor accordingly
- Modify the `initStageNav` function in `assets/ts/desktop/stageNav.ts` to handle close click events by calling the `handleClick` function and setting `isLoading` state to false
- Modify the `initStageNav` function in `assets/ts/desktop/stageNav.ts` to handle previous/next click events by calling the `handleClick` function only if `isLoading` is false
- Modify the `initStageNav` function in `assets/ts/desktop/stageNav.ts` to handle previous/next hover events by setting `loadedText` and updating custom cursor depending on `isLoading` state

* feat: refactor createGallery function and enhance loading functionality on mobile

- Add a loading text element to the gallery.scss file
- Add a loading indicator to the createGallery function in gallery.ts
- Modify the createGallery function in gallery.ts to hide the loading text element on image load
- Move the image element append logic to the parent container in the createGallery function in gallery.ts

* feat: update translations and add new loading translation in i18n files

* chore: remove css source map

* chore: modify build command to ignore css source map

* refactor: remove unnecessary style

* fix: fix desktop cursor text transition bug
2024-01-20 23:34:13 +08:00
Spedon
8c6b38bb49 fix: put article into container for style issue (#243) 2024-01-20 18:20:51 +08:00
Spedon
ae1a08eb82 feat: embed threshold and index val of navbar into html/inline js (#241)
* feat: refactor image retrieval logic and improve variable initialization

- Add a new file `layouts/partials/function/getImageSlice.html`
- Initialize variables `$context`, `$Path`, and `$params`
- Set `$Path` based on the result of the `partial/function/currentMenuItem.html` partial
- Retrieve the page `$gallery` based on `$Path`
- Return all resources of type `image` from `$gallery`

* refactor: adapt getImageSlice function to `single.json`

* feat: refactor navigation UI components to use static go template

* feat: update navigation functionality and threshold rendering
2024-01-20 18:03:26 +08:00
Spedon
8ba41fc32c v0.0.5 (#219)
* feat: refactor condition for checking `site.Params.bundled`

- Add default condition for checking if `site.Params.bundled` is true or false

* refactor: update info page content

* chore: update site description

* refactor: refactor variable assignments and return statement in menu template

- Change the variable assignment from `.DirName` to `.Identifier` in the file `layouts/_default/single.json`
- Change the variable assignments in the file `layouts/partials/function/currentMenuItem.html`:
  - From `$dirName := ""` to `$identifier := ""`
  - From `$id := -1` to `$title := ""` and `$weight := -1`
  - From `$dirName = .Identifier` to `$identifier = .Identifier`, `$title = .Title`, and `$weight = .Weight`
- Change the return statement in the file `layouts/partials/function/currentMenuItem.html` from `(dict "DirName" $dirName "ID" $id)` to `(dict "Identifier" $identifier "Title" $title "Weight" $weight)`

* feat: update nav links structure for current link styling

- Remove javascript code related to setting current link style and title
- Update nav links to use updated HTML structure for current link styling

* feat: update page titles and meta tags in layout files

- Update the `baseof.html` layout to include the current page title in the `<title>` tag
- Add OpenGraph meta tags for the page title and description in `meta.html` layout
2024-01-07 23:16:55 +08:00
Spedon
9b08d255f1 Use JSON file to replace raw string in DOM (#147)
* chore(Geist): bump geist font to v1.0.1

* refactor(_typography.scss): split the CSS lang tag to ensure compatibility with Chromium-based browsers

* refactor(stage.ts): bump up preload count on desktop

* feat(params.toml): add support for user defined resize option

* feat(_fonts.scss): add a new font file to better support fullwidth plus and minus

* refactor(info): update info

* chore(build.yml): update branch name for updating bundled artifacts to include the current date

* chore(package.json): update version from 0.0.1 to v0.0.2 to reflect changes made in the codebase

* feat: refactor initialization process for retrieving and sorting image data

- Modify `main.ts` to use async initialization of resources
- Change the return type of `initResources` function to `Promise<ImageJSON[]>`
- Add try-catch block to handle errors in `initResources` function
- Use fetch API to retrieve image data from `index.json`
- Sort the image data based on the index field

* refactor: update file naming and variable assignments in layouts

- Add new file `exampleSite/config/_default/outputs.toml` with the contents `page = ["HTML", "JSON"]`
- Rename file `layouts/partials/resources/imageJSON.html` to `layouts/_default/single.json`
- Modify variable assignments and references in the `single.json` layou

* chore: remove code that includes imageJSON.html partials in layouts

- Remove the code that includes the "resources/imageJSON.html" partial in the 404.html layout
- Remove the code that includes the "resources/imageJSON.html" partial in the single.html layout
2023-11-13 20:51:08 +08:00
Spedon
9c073e98e1 v0.0.2 (#144)
* chore(Geist): bump geist font to v1.0.1

* refactor(_typography.scss): split the CSS lang tag to ensure compatibility with Chromium-based browsers

* refactor(stage.ts): bump up preload count on desktop

* feat(params.toml): add support for user defined resize option

* feat(_fonts.scss): add a new font file to better support fullwidth plus and minus

* refactor(info): update info

* chore(build.yml): update branch name for updating bundled artifacts to include the current date

* chore(package.json): update version from 0.0.1 to v0.0.2 to reflect changes made in the codebase
2023-11-10 21:00:09 +08:00
Spedon
f083407889 add i18n 404 and README support (#132)
* feat(params.toml): enable analytics and configure Umami Analytics

Enable analytics by setting `enable` to `true` in the `[analytics]` section of the `params.toml` file. Also, configure Umami Analytics by providing the `data_website_id`, `src`, and `data_domains` values.

* feat(404.html): replace hardcoded "404 page not found" text with translated version to improve localization

* feat(README.md): add README.md file with information about the Bridget theme and its features
feat(getStarted.md): add getStarted.md file with instructions on how to get started with the Bridget theme, including installation and content management instructions
2023-11-06 16:07:56 +08:00
Sped0n
8d9dc0c121 refactor(favicon); change favicon related setup 2023-11-04 16:27:05 +08:00
Sped0n
f9697eb645 fix(nav.html): capitalize the first letter of the word "threshold" in the nav.html template to improve consistency with other translations 2023-11-04 15:02:02 +08:00
Sped0n
7150be69d6 feat(baseof.html): include favicon partial in head section of baseof.html layout for favicon rendering 2023-11-04 14:29:09 +08:00
Sped0n
6a0e06b050 feat(link.html): add support for deferred loading and ES modules for main style and js files 2023-11-03 14:27:42 +08:00
Sped0n
43330579bd feat(seo.html): add meta tags for site verification codes (Google, Bing, Yandex, Pinterest, Baidu, So, Sogou) to improve SEO and site ownership verification
feat(analytics.html): create partial to include analytics scripts for various analytics services (Google Analytics, Fathom Analytics, Baidu Analytics, Umami Analytics, Plausible Analytics, Cloudflare Analytics, Splitbee Analytics) to track website traffic and user behavior
2023-11-03 14:25:20 +08:00
Sped0n
1910eb21db feat(plugin/style.html): add .Link tag to set href directly 2023-11-03 14:23:37 +08:00
Sped0n
c0283620bd feat(plugin): add script.html partial template to handle rendering of script tags with various attributes and options
The `script.html` partial template has been added to handle the rendering of script tags with various attributes and options. It supports the following features:

- If the `Content` variable is provided, it will be rendered as the content of the script tag.
- If the `Source` variable starts with "<script", it will be rendered as safe HTML.
- If the `Source` variable is provided and is a local resource, it will be processed as a template and minified if specified.
- If the `Fingerprint` variable is provided, the resource will be fingerprinted and the integrity attribute will be set accordingly.
- The `Link` variable can be used to specify an external script URL.
- The `Esm` variable can be set to true to render the script tag as a module.
- The `Crossorigin` variable can be set to true to add the crossorigin attribute.
- The `Async` variable can be set to true to add the async attribute.
- The `Defer` variable can be set to true to add the defer attribute.
- The `Attr` variable can be used to add additional attributes to the script tag.

This new partial template provides flexibility and customization options for rendering script tags in the application.
2023-11-03 14:21:07 +08:00
Sped0n
f4eda42785 feat(i18n): add translations for the new languages (de, es, fr, it, CJK) 2023-11-03 14:19:06 +08:00
Sped0n
325acbd194 feat(sitemap.xml): add sitemap.xml layout file to generate a sitemap for the website
The sitemap.xml layout file is added to the project. This layout file generates a sitemap for the website using the data from the pages. The sitemap includes URLs for all pages except those in the "gallery" section. Each URL includes the location, last modified date (if available), change frequency (if available), and priority (if available). If a page is translated, alternate links are included for each translation.
2023-11-03 10:11:28 +08:00
Sped0n
88da65ef67 feat(robots.txt): add robots.txt file to block unwanted bots and allow all other bots to crawl the site
The robots.txt file is added to the layouts directory. This file includes rules to block specific bots from crawling the site. The following bots are blocked: MJ12bot, AhrefsBot, BLEXBot, SISTRIX Crawler, sistrix, 007ac9, 007ac9 Crawler, UptimeRobot/2.0, Ezooms Robot, Perl LWP, netEstate NE Crawler (+http://www.website-datenbank.de/), WiseGuys Robot, Turnitin Robot, Heritrix, pricepi, SurdotlyBot, and ZoominfoBot. All other bots are allowed to crawl the site. The file also includes a sitemap directive to point to the sitemap.xml file.
2023-11-03 10:11:02 +08:00
Sped0n
bcf4c374d9 feat(meta.html): add meta tags for description, application name, and apple-mobile-web-app-title
The meta.html file was modified to add three meta tags. The first meta tag sets the description of the website using the `site.Params.description` value. The second meta tag sets the application name using the `site.Params.app.title` value or falls back to the site title if not provided. The third meta tag sets the apple-mobile-web-app-title using the same logic as the second meta tag. These changes were made to improve the SEO and user experience of the website.
2023-11-03 10:10:41 +08:00
Sped0n
339a78364a feat(link.html): update font preload links to use appropriate font files based on language code for improved font rendering 2023-11-03 10:09:24 +08:00
Sped0n
10efa941f2 feat(langCode.html): add a new partial template to check if the current language code matches the site's language code
The `langCode.html` partial template is added to the `layouts/partials/function` directory. This template is used to check if the current language code matches the site's language code. It iterates over the language codes and sets a boolean variable `$res` to `true` if there is a match. The template then returns the value of `$res`. This partial template can be used in other templates to conditionally render content based on the language code.
2023-11-03 10:01:47 +08:00
Sped0n
5c69862832 fix(layouts): fix variable name from $name to $dirName in currentMenuItem.html partial to improve semantics and clarity 2023-11-03 09:51:44 +08:00
Sped0n
eb6c485ea5 refactor(baseof.html): update language attribute to use site.LanguageCode variable for better localization support
refactor(baseof.html): update page title to use site.Title variable for consistency and easier maintenance
refactor(nav.html): update anchor tags to use relURL instead of relLangURL for correct URL generation
refactor(nav.html): update link text to use .Title instead of .Identifier for better readability
2023-11-03 09:50:32 +08:00
Sped0n
ed40ddd27e chore(imageJSON.html): add alt attribute to images in imageJSON partial to improve accessibility 2023-11-03 09:49:40 +08:00
Sped0n
4c09b08172 Merge remote-tracking branch 'origin/main' into main
feat(params.toml): add 'bundled' parameter to control whether to use bundled js and css or build from scratch
2023-11-02 10:50:24 +08:00
Sped0n
df5d839074 chore(link.html): update critical style source and options to improve performance and maintainability
chore(link.html): update main style source and options to improve performance and maintainability
chore(link.html): remove unused meta.html file
chore(nav.html): update decrement and increment buttons to use Unicode characters for better accessibility
chore(plugin/style.html): update style plugin to support inline styles for critical CSS
chore(plugin/style.html): update style plugin to support minification and fingerprinting for main CSS
chore(plugin/style.html): remove script plugin as it is no longer used
chore(plugin/style.html): update style plugin to support inline styles for critical CSS
chore(plugin/style.html): update style plugin to support minification and fingerprinting for main CSS
chore(resources/imageJSON.html): update image resize options for better performance and quality
2023-11-01 23:09:53 +08:00
Sped0n
1ac67f17ae feat(404.html): add 404 page layout
The 404.html file is a new file added to the layouts directory. This file defines the layout for the 404 page. It includes a container div, a navigation partial, and an article element with three paragraphs displaying the "404 page not found" message. This layout will be used when a user navigates to a non-existent page on the website.
2023-11-01 23:09:27 +08:00
Sped0n
bb15dbea36 chore(style.scss): update import statement for article partial to import swiper.scss from node_modules
chore(link.html): remove unused swiper css import statement
2023-11-01 23:04:05 +08:00
Sped0n
9bbf3a7f7a chore(hugo.toml): remove unused disableKinds to improve build performance
chore(params.toml): add website title parameter for better customization
chore(baseof.html): update page title to use the website title parameter
chore(nav.html): update navigation link to use the website title parameter
2023-11-01 22:59:03 +08:00
Sped0n
ee40055d6a feat(link.html): add support for minification of style and script files based on Hugo production mode 2023-10-31 00:07:51 +08:00
Sped0n
bf859ebed9 feat(plugin/script.html): add support for ESBuild to optimize JavaScript resources 2023-10-31 00:07:27 +08:00
Sped0n
3cbbc5b6da refactor(resources.ts): update ImageJSON interface to include separate properties for low resolution and high resolution image URLs, heights, and widths for better organization and clarity
refactor(imageJSON.html): modify image resizing logic to generate separate low resolution and high resolution image URLs, heights, and widths to improve performance and optimize image loading
2023-10-30 17:44:59 +08:00
Sped0n
33c9f863c8 feat(year.html): add new shortcode to display the current year
The `year.html` file is a new file that has been added. It contains a shortcode that displays the current year using the `now.Year` variable. This shortcode can be used in the layout templates to dynamically display the current year.
2023-10-30 15:58:53 +08:00
Sped0n
e20fb7c105 feat(imageJSON.html): add imageJSON.html partial template to generate JSON data for image resources
The imageJSON.html partial template has been added to the layouts/partials/resources directory. This template generates JSON data for image resources on a page. It retrieves the page context and the gallery resources using the site.GetPage and .Resources.ByType functions. It then iterates over the image resources, resizing them and adding their information to a Scratch variable. Finally, it outputs the JSON data as a script tag with the id "imagesSource". This JSON data can be used to dynamically load and display images on the page.
2023-10-30 15:58:37 +08:00
Sped0n
2553c7e1fc feat(plugin): add script.html partial template to handle rendering of script tags with various options
The `script.html` partial template has been added to handle the rendering of script tags with various options. This template supports the following features:

- If the `Content` variable is provided, it will be rendered as the content of the script tag.
- If the `Source` variable starts with "<script", it will be rendered as safe HTML.
- If the `Source` variable is provided and is a local resource, it will be processed as a template and minified if specified. If the `Fingerprint` variable is provided, the resource will also be fingerprinted and the integrity attribute will be set accordingly.
- If the `Link` variable is provided, it will be used as the source of the script tag.
- The `Crossorigin` variable can be used to add the crossorigin attribute to the script tag.
- The `Async` variable can be used to add the async attribute to the script tag.
- The `Defer` variable can be used to add the defer attribute to the script tag.
- The `Attr` variable can be used to add additional attributes to the script tag.

This new partial template provides flexibility in rendering script tags with different options based on the provided variables.
2023-10-30 15:58:00 +08:00
Sped0n
a74f15b908 feat(currentMenuItem.html): add template partial to retrieve the current menu item based on the current page URL
The currentMenuItem.html template partial is added to the layouts/partials/function directory. This partial is used to retrieve the current menu item based on the current page URL. It iterates through the main menu items defined in the site configuration and compares the URL of each menu item with the URL of the current page. If a match is found, the name and ID of the menu item are stored in variables. Finally, a dictionary containing the name and ID is returned. This partial can be used to highlight the current menu item in the navigation menu.
2023-10-30 15:57:32 +08:00
Sped0n
1632803e91 refactor(plugin/style.html): improve code formatting and indentation for better readability 2023-10-30 15:57:13 +08:00
Sped0n
0b350db741 feat(layouts): add baseof.html layout template
This commit adds a new layout template called baseof.html. This template is used as the base layout for all other templates in the project. It includes the basic HTML structure, meta tags, and a placeholder for the main content.

The purpose of this change is to provide a consistent and reusable base layout for all pages in the project, reducing code duplication and improving maintainability.

---

feat(layouts): add single.html layout template

This commit adds a new layout template called single.html. This template is used for rendering individual content pages. It includes a block for the main content and some additional logic for handling the current menu item and generating image JSON.

The purpose of this change is to provide a specific layout for individual content pages, allowing for customization and flexibility in their presentation.

---

refactor(layouts): remove index.html layout template and related partials

This commit removes the index.html layout template and its associated partials (footer.html, head.html, link.html, meta.html, seo.html, mobile_wrapper.html, and nav.html).

The index.html layout template was no longer needed as the project has transitioned to using the baseof.html and single.html templates for rendering pages. The associated partials were also no longer used and can be safely removed.

The purpose of this change is to clean up unused code and reduce clutter in the project.
2023-10-30 15:56:43 +08:00