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: only print tags and redir generation in debug mode #907

Merged
merged 2 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 10 additions & 3 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ exports.createPages = async ({ graphql, actions }) => {
}
`);
tags.data.tagsGroup.group.forEach((tag) => {
console.log(`Creating tag page: ${tag.fieldValue}`);
if (process.env.DEBUG === "true") {
console.log(`Creating tag page: ${tag.fieldValue}`);
}
createPage({
path: `/argomenti/${_.kebabCase(tag.fieldValue)}/`,
component: tagTemplate,
Expand All @@ -153,7 +155,9 @@ exports.createPages = async ({ graphql, actions }) => {
}
`);
tagsDesignSystem.data.tagsDesignSystemGroup.group.forEach((tag) => {
console.log(`Creating tag page: ${tag.fieldValue}`);
if (process.env.DEBUG === "true") {
console.log(`Creating tag page: ${tag.fieldValue}`);
}
createPage({
path: `/design-system/componenti/utili-per/${_.kebabCase(
tag.fieldValue,
Expand Down Expand Up @@ -187,7 +191,10 @@ exports.createPages = async ({ graphql, actions }) => {
const { node } = edge;
node.metadata.redirect_from.forEach((fromPath) => {
const toPath = edge.node.seo.pathname;
console.log(`Creating redirect: ${fromPath} -> ${toPath}...`);
if (process.env.DEBUG === "true") {
console.log(`Creating redirect: ${fromPath} -> ${toPath}...`);
}

createRedirect({ fromPath, toPath });
});
});
Expand Down
217 changes: 0 additions & 217 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"site"
],
"scripts": {
"prepare-lib": "recursive-copy -w ./node_modules/bootstrap-italia/dist/svg/ ./static/svg/ && recursive-copy -w ./node_modules/bootstrap-italia/dist/svg/ ./static/dist/svg/ && recursive-copy -w ./node_modules/bootstrap-italia/dist/fonts/ ./static/fonts/ && recursive-copy -w ./node_modules/bootstrap-italia/dist/fonts/ ./static/dist/fonts/",
"prepare-lib": "cp -r node_modules/bootstrap-italia/dist/svg/ static/ && cp -r node_modules/bootstrap-italia/dist/fonts static/",
"prepare-content": "node ./scripts/prepare.js",
"start": "npm run prepare-lib && gatsby develop",
"develop": "npm run start",
Expand Down Expand Up @@ -88,7 +88,6 @@
"gh-pages": "^6.0.0",
"mustache": "^4.2.0",
"prettier": "3.0.3",
"recursive-copy-cli": "^1.0.20",
"slugify": "^1.6.5"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
<script
src="https://cdn.jsdelivr.net/npm/bootstrap-italia@2.7.5/dist/js/bootstrap-italia.bundle.min.js"></script>
<script>
bootstrap.loadFonts(window.__PUBLIC_PATH__ = "/dist/fonts/");
bootstrap.loadFonts(window.__PUBLIC_PATH__ = "/fonts/");

// tooltip
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ <h2 class="accordion-header" id="heading3a">
<script
src="https://cdn.jsdelivr.net/npm/bootstrap-italia@2.7.5/dist/js/bootstrap-italia.bundle.min.js"></script>
<script>
bootstrap.loadFonts(window.__PUBLIC_PATH__ = "/dist/fonts/");
bootstrap.loadFonts(window.__PUBLIC_PATH__ = "/fonts/");

// tooltip
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
Expand Down
2 changes: 1 addition & 1 deletion static/examples/bsi/componenti/accordion/accordion.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ <h2 class="accordion-header" id="heading3">
<script
src="https://cdn.jsdelivr.net/npm/bootstrap-italia@2.7.5/dist/js/bootstrap-italia.bundle.min.js"></script>
<script>
bootstrap.loadFonts(window.__PUBLIC_PATH__ = "/dist/fonts/");
bootstrap.loadFonts(window.__PUBLIC_PATH__ = "/fonts/");

// tooltip
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
Expand Down
Loading
Loading