init: Vite+React+Tailwind v2 site with HTML content from WP, RSS feed, external feed aggregator, prerender
This commit is contained in:
1
src/content/ads.json
Normal file
1
src/content/ads.json
Normal file
@@ -0,0 +1 @@
|
||||
[]
|
||||
8
src/content/feeds.json
Normal file
8
src/content/feeds.json
Normal file
@@ -0,0 +1,8 @@
|
||||
[
|
||||
{
|
||||
"name": "Подмосковье сегодня — Пушкино",
|
||||
"url": "https://mosregtoday.ru/tags/пушкино/rss/",
|
||||
"enabled": false,
|
||||
"max": 10
|
||||
}
|
||||
]
|
||||
38
src/content/index.js
Normal file
38
src/content/index.js
Normal file
@@ -0,0 +1,38 @@
|
||||
import postsArr from './posts.json';
|
||||
import pagesArr from './pages.json';
|
||||
import partnersArr from './partners.json';
|
||||
import adsArr from './ads.json';
|
||||
import transportArr from './transport.json';
|
||||
import feedsArr from './feeds.json';
|
||||
|
||||
const byField = (arr, field) => Object.fromEntries(arr.map((x) => [x[field], x]));
|
||||
|
||||
export const postsList = postsArr;
|
||||
export const pagesList = pagesArr;
|
||||
export const posts = byField(postsArr, 'slug');
|
||||
export const pages = byField(pagesArr, 'slug');
|
||||
export const oldSlugRedirects = (() => {
|
||||
const map = {};
|
||||
for (const p of postsArr) {
|
||||
if (p.oldSlug && p.oldSlug !== p.slug) map[`/${p.oldSlug}/`] = `/${p.slug}/`;
|
||||
}
|
||||
for (const p of pagesArr) {
|
||||
if (p.oldSlug && p.oldSlug !== p.slug) map[`/${p.oldSlug}/`] = `/${p.slug}/`;
|
||||
}
|
||||
return map;
|
||||
})();
|
||||
export const partners = partnersArr;
|
||||
export const ads = adsArr;
|
||||
export const transport = transportArr;
|
||||
export const externalFeeds = feedsArr;
|
||||
|
||||
export const categories = (() => {
|
||||
const set = new Map();
|
||||
for (const p of postsArr) {
|
||||
p.categorySlugs?.forEach((s, i) => {
|
||||
if (!set.has(s)) set.set(s, { slug: s, name: p.categories[i], count: 0 });
|
||||
set.get(s).count += 1;
|
||||
});
|
||||
}
|
||||
return [...set.values()];
|
||||
})();
|
||||
46
src/content/pages.json
Normal file
46
src/content/pages.json
Normal file
File diff suppressed because one or more lines are too long
12
src/content/partners.json
Normal file
12
src/content/partners.json
Normal file
@@ -0,0 +1,12 @@
|
||||
[
|
||||
{
|
||||
"name": "Музей города Пушкино",
|
||||
"url": "https://museum-pushkino.ru/",
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"name": "Краеведческий архив Пушкино",
|
||||
"url": "",
|
||||
"note": "по запросу"
|
||||
}
|
||||
]
|
||||
113
src/content/posts.json
Normal file
113
src/content/posts.json
Normal file
File diff suppressed because one or more lines are too long
14
src/content/transport.json
Normal file
14
src/content/transport.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"trains": [
|
||||
{
|
||||
"label": "Расписание электричек со ст. Пушкино",
|
||||
"url": "https://rasp.yandex.ru/station/9601728/"
|
||||
}
|
||||
],
|
||||
"buses": [
|
||||
{
|
||||
"label": "Маршруты автобусов по Пушкино",
|
||||
"url": "https://mostransport.ru/"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user