Skip to content

Commit

Permalink
pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
flashdesignory committed Dec 5, 2024
1 parent 6dad4b0 commit 2d1c36f
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 31 deletions.
40 changes: 20 additions & 20 deletions resources/newssite/news-nuxt/composables/provide-locale.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,39 +20,39 @@ export function provideLocale() {

const { content } = dataSource[lang];

const selected = Object.create(null);
// Generate unique IDs for all articles, and their content items where appropriate.
const contentWithIds = Object.create(null);
Object.keys(content).forEach((key) => {
const { sections } = content[key];

const selectedSections = [];

for (let i = 0; i < sections.length; i++) {
const selectedSection = { ...sections[i] };
selectedSections.push(selectedSection);

const { articles } = selectedSections[i];
for (let j = 0; j < articles.length; j++) {
articles[j].id = uuidv4();
const { content } = articles[j];
if (Array.isArray(content)) {
for (let k = 0; k < content.length; k++)
content[k].id = uuidv4();
const currentSections = sections.map((section) => {
const currentSection = { ...section };
currentSection.articles = section.articles.map((article) => {
const currentArticle = { ...article };
currentArticle.id = uuidv4();
if (Array.isArray(article.content)) {
currentArticle.content = article.content.map((item) => {
const currentItem = { ...item };
currentItem.id = uuidv4();
return currentItem;
});
}
return currentArticle;
});
return currentSection;
});

}
}

selected[key] = {
contentWithIds[key] = {
...content[key],
sections: selectedSections,
sections: currentSections,
};
});

const value = {
lang,
dir,
...dataSource[lang],
content: selected,
content: contentWithIds,
};

provide("data", value);
Expand Down
4 changes: 2 additions & 2 deletions resources/newssite/news-nuxt/dist/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<head><meta charset="utf-8">
<title>The Daily Broadcast</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="A news site developed with Nuxt."><link rel="modulepreload" as="script" crossorigin href="./_nuxt/entry.8b385d26.js"><link rel="preload" as="style" href="./_nuxt/entry.4163a698.css"><link rel="prefetch" as="script" crossorigin href="./_nuxt/error-component.649814ff.js"><link rel="stylesheet" href="./_nuxt/entry.4163a698.css"></head>
<body ><div id="__nuxt"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4},{},false,{},{}]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"./",buildAssetsDir:"/_nuxt/",cdnURL:"./"}}</script><script type="module" src="./_nuxt/entry.8b385d26.js" crossorigin></script></body>
<meta name="description" content="A news site developed with Nuxt."><link rel="modulepreload" as="script" crossorigin href="./_nuxt/entry.30f4d106.js"><link rel="preload" as="style" href="./_nuxt/entry.4163a698.css"><link rel="prefetch" as="script" crossorigin href="./_nuxt/error-component.1bc5c237.js"><link rel="stylesheet" href="./_nuxt/entry.4163a698.css"></head>
<body ><div id="__nuxt"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4},{},false,{},{}]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"./",buildAssetsDir:"/_nuxt/",cdnURL:"./"}}</script><script type="module" src="./_nuxt/entry.30f4d106.js" crossorigin></script></body>
</html>

Large diffs are not rendered by default.

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

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

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

4 changes: 2 additions & 2 deletions resources/newssite/news-nuxt/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<head><meta charset="utf-8">
<title>The Daily Broadcast</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="A news site developed with Nuxt."><link rel="modulepreload" as="script" crossorigin href="./_nuxt/entry.8b385d26.js"><link rel="preload" as="style" href="./_nuxt/entry.4163a698.css"><link rel="prefetch" as="script" crossorigin href="./_nuxt/error-component.649814ff.js"><link rel="stylesheet" href="./_nuxt/entry.4163a698.css"></head>
<body ><div id="__nuxt"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4},{},false,{},{}]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"./",buildAssetsDir:"/_nuxt/",cdnURL:"./"}}</script><script type="module" src="./_nuxt/entry.8b385d26.js" crossorigin></script></body>
<meta name="description" content="A news site developed with Nuxt."><link rel="modulepreload" as="script" crossorigin href="./_nuxt/entry.30f4d106.js"><link rel="preload" as="style" href="./_nuxt/entry.4163a698.css"><link rel="prefetch" as="script" crossorigin href="./_nuxt/error-component.1bc5c237.js"><link rel="stylesheet" href="./_nuxt/entry.4163a698.css"></head>
<body ><div id="__nuxt"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4},{},false,{},{}]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"./",buildAssetsDir:"/_nuxt/",cdnURL:"./"}}</script><script type="module" src="./_nuxt/entry.30f4d106.js" crossorigin></script></body>
</html>

0 comments on commit 2d1c36f

Please sign in to comment.