404Notice
parent
3d766bf4bf
commit
0ce8e447f4
|
@ -8,7 +8,10 @@ import vue from "@astrojs/vue";
|
|||
|
||||
// https://astro.build/config
|
||||
|
||||
// https://astro.build/config
|
||||
import partytown from "@astrojs/partytown";
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({
|
||||
integrations: [tailwind(), vue()]
|
||||
integrations: [tailwind(), vue(), partytown()]
|
||||
});
|
|
@ -1,18 +1,24 @@
|
|||
{
|
||||
"name": "@example/basics",
|
||||
"name": "sreechaitanyacollege.in",
|
||||
"version": "0.0.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@example/basics",
|
||||
"name": "sreechaitanyacollege.in",
|
||||
"version": "0.0.1",
|
||||
"dependencies": {
|
||||
"@astrojs/partytown": "^1.2.1",
|
||||
"@astrojs/tailwind": "^2.1.3",
|
||||
"@astrojs/vue": "^1.2.2",
|
||||
"@headlessui/vue": "^1.7.13",
|
||||
"@heroicons/vue": "1.0.6",
|
||||
"astro": "^1.7.2",
|
||||
"tailwindcss": "^3.2.4",
|
||||
"vue": "^3.2.45"
|
||||
},
|
||||
"devDependencies": {
|
||||
"sass": "^1.57.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@ampproject/remapping": {
|
||||
|
@ -101,6 +107,15 @@
|
|||
"vfile-message": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@astrojs/partytown": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@astrojs/partytown/-/partytown-1.2.1.tgz",
|
||||
"integrity": "sha512-sFs4RKaahYOrHKy5rM6xf5xDavKpUICVxS0P0tQec5z3+FRq1Eo57MDTCx2QJoIhOHd3+/GgXDRHKWpbFI4RCw==",
|
||||
"dependencies": {
|
||||
"@builder.io/partytown": "^0.7.4",
|
||||
"mrmime": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@astrojs/prism": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@astrojs/prism/-/prism-1.0.2.tgz",
|
||||
|
@ -605,6 +620,14 @@
|
|||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@builder.io/partytown": {
|
||||
"version": "0.7.6",
|
||||
"resolved": "https://registry.npmjs.org/@builder.io/partytown/-/partytown-0.7.6.tgz",
|
||||
"integrity": "sha512-snXIGNiZpqjno3XYQN2lbBB+05hsQR/LSttbtIW1c0gmZ7Kh/DIo0YrxlDxCDulAMFPFM8J+4voLwvYepSj3sw==",
|
||||
"bin": {
|
||||
"partytown": "bin/partytown.cjs"
|
||||
}
|
||||
},
|
||||
"node_modules/@emmetio/abbreviation": {
|
||||
"version": "2.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@emmetio/abbreviation/-/abbreviation-2.2.3.tgz",
|
||||
|
@ -656,6 +679,25 @@
|
|||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@headlessui/vue": {
|
||||
"version": "1.7.13",
|
||||
"resolved": "https://registry.npmjs.org/@headlessui/vue/-/vue-1.7.13.tgz",
|
||||
"integrity": "sha512-obG5TdPdBDfs+jiA1mY29LPFqyJl93Q90EL86ontfRe1B6XvbjPkx+x1aAC5DA18bXbb0Juni1ayDbXo0w1u0A==",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vue": "^3.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@heroicons/vue": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@heroicons/vue/-/vue-1.0.6.tgz",
|
||||
"integrity": "sha512-ng2YcCQrdoQWEFpw+ipFl2rZo8mZ56v0T5+MyfQQvNqfKChwgP6DMloZLW+rl17GEcHkE3H82UTAMKBKZr4+WA==",
|
||||
"peerDependencies": {
|
||||
"vue": ">= 3"
|
||||
}
|
||||
},
|
||||
"node_modules/@jridgewell/gen-mapping": {
|
||||
"version": "0.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz",
|
||||
|
@ -2931,6 +2973,12 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"node_modules/immutable": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.0.tgz",
|
||||
"integrity": "sha512-0AOCmOip+xgJwEVTQj1EfiDDOkPmuyllDuTuEX+DDXUgapLAsBIfkg3sxCYyCEA8mQqZrrxPUGjcOQ2JS3WLkg==",
|
||||
"devOptional": true
|
||||
},
|
||||
"node_modules/import-meta-resolve": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-2.2.0.tgz",
|
||||
|
@ -5307,6 +5355,23 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"node_modules/sass": {
|
||||
"version": "1.62.1",
|
||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.62.1.tgz",
|
||||
"integrity": "sha512-NHpxIzN29MXvWiuswfc1W3I0N8SXBd8UR26WntmDlRYf0bSADnwnOjsyMZ3lMezSlArD33Vs3YFhp7dWvL770A==",
|
||||
"devOptional": true,
|
||||
"dependencies": {
|
||||
"chokidar": ">=3.0.0 <4.0.0",
|
||||
"immutable": "^4.0.0",
|
||||
"source-map-js": ">=0.6.2 <2.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"sass": "sass.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/sass-formatter": {
|
||||
"version": "0.7.5",
|
||||
"resolved": "https://registry.npmjs.org/sass-formatter/-/sass-formatter-0.7.5.tgz",
|
||||
|
@ -6464,6 +6529,15 @@
|
|||
"vfile-message": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"@astrojs/partytown": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@astrojs/partytown/-/partytown-1.2.1.tgz",
|
||||
"integrity": "sha512-sFs4RKaahYOrHKy5rM6xf5xDavKpUICVxS0P0tQec5z3+FRq1Eo57MDTCx2QJoIhOHd3+/GgXDRHKWpbFI4RCw==",
|
||||
"requires": {
|
||||
"@builder.io/partytown": "^0.7.4",
|
||||
"mrmime": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"@astrojs/prism": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@astrojs/prism/-/prism-1.0.2.tgz",
|
||||
|
@ -6832,6 +6906,11 @@
|
|||
"to-fast-properties": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"@builder.io/partytown": {
|
||||
"version": "0.7.6",
|
||||
"resolved": "https://registry.npmjs.org/@builder.io/partytown/-/partytown-0.7.6.tgz",
|
||||
"integrity": "sha512-snXIGNiZpqjno3XYQN2lbBB+05hsQR/LSttbtIW1c0gmZ7Kh/DIo0YrxlDxCDulAMFPFM8J+4voLwvYepSj3sw=="
|
||||
},
|
||||
"@emmetio/abbreviation": {
|
||||
"version": "2.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@emmetio/abbreviation/-/abbreviation-2.2.3.tgz",
|
||||
|
@ -6865,6 +6944,18 @@
|
|||
"integrity": "sha512-L4jVKS82XVhw2nvzLg/19ClLWg0y27ulRwuP7lcyL6AbUWB5aPglXY3M21mauDQMDfRLs8cQmeT03r/+X3cZYQ==",
|
||||
"optional": true
|
||||
},
|
||||
"@headlessui/vue": {
|
||||
"version": "1.7.13",
|
||||
"resolved": "https://registry.npmjs.org/@headlessui/vue/-/vue-1.7.13.tgz",
|
||||
"integrity": "sha512-obG5TdPdBDfs+jiA1mY29LPFqyJl93Q90EL86ontfRe1B6XvbjPkx+x1aAC5DA18bXbb0Juni1ayDbXo0w1u0A==",
|
||||
"requires": {}
|
||||
},
|
||||
"@heroicons/vue": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@heroicons/vue/-/vue-1.0.6.tgz",
|
||||
"integrity": "sha512-ng2YcCQrdoQWEFpw+ipFl2rZo8mZ56v0T5+MyfQQvNqfKChwgP6DMloZLW+rl17GEcHkE3H82UTAMKBKZr4+WA==",
|
||||
"requires": {}
|
||||
},
|
||||
"@jridgewell/gen-mapping": {
|
||||
"version": "0.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz",
|
||||
|
@ -8436,6 +8527,12 @@
|
|||
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
|
||||
"integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="
|
||||
},
|
||||
"immutable": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.0.tgz",
|
||||
"integrity": "sha512-0AOCmOip+xgJwEVTQj1EfiDDOkPmuyllDuTuEX+DDXUgapLAsBIfkg3sxCYyCEA8mQqZrrxPUGjcOQ2JS3WLkg==",
|
||||
"devOptional": true
|
||||
},
|
||||
"import-meta-resolve": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-2.2.0.tgz",
|
||||
|
@ -9932,6 +10029,17 @@
|
|||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
|
||||
},
|
||||
"sass": {
|
||||
"version": "1.62.1",
|
||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.62.1.tgz",
|
||||
"integrity": "sha512-NHpxIzN29MXvWiuswfc1W3I0N8SXBd8UR26WntmDlRYf0bSADnwnOjsyMZ3lMezSlArD33Vs3YFhp7dWvL770A==",
|
||||
"devOptional": true,
|
||||
"requires": {
|
||||
"chokidar": ">=3.0.0 <4.0.0",
|
||||
"immutable": "^4.0.0",
|
||||
"source-map-js": ">=0.6.2 <2.0.0"
|
||||
}
|
||||
},
|
||||
"sass-formatter": {
|
||||
"version": "0.7.5",
|
||||
"resolved": "https://registry.npmjs.org/sass-formatter/-/sass-formatter-0.7.5.tgz",
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"@astrojs/partytown": "^1.2.1",
|
||||
"@astrojs/tailwind": "^2.1.3",
|
||||
"@astrojs/vue": "^1.2.2",
|
||||
"@headlessui/vue": "^1.7.13",
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
RewriteEngine On
|
||||
#RewriteCond %{HTTPS} !=on
|
||||
#RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
|
||||
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
|
||||
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule ^(.*) /404
|
|
@ -57,25 +57,14 @@ export default {
|
|||
this.file = this.page.attachments
|
||||
// console.log(this.file)
|
||||
this.isLoading = false
|
||||
});
|
||||
fetch('https://api8.siliconpin.com/items/scc22?filter[slug][_eq]=' + path[2])
|
||||
.then((response) => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
}
|
||||
// throw new Error('Something went wrong');
|
||||
return this.page.id
|
||||
})
|
||||
.then(jsonPageData => {
|
||||
this.page = jsonPageData.data
|
||||
console.log(this.page)
|
||||
this.isLoading = false
|
||||
return jsonPageData.data[0].id
|
||||
}
|
||||
)
|
||||
.then((pageID) => {
|
||||
console.log(pageID)
|
||||
fetch('https://api8.siliconpin.com/items/scc22_files_1?filter[scc22_id][_in]=' + pageID)
|
||||
.then(resp => resp.json())
|
||||
.then(file => {
|
||||
console.log(file)
|
||||
let attIDs = ''
|
||||
let t = 0
|
||||
file.data.forEach(ids => {
|
||||
|
@ -84,6 +73,7 @@ export default {
|
|||
t++
|
||||
});
|
||||
if(t>0) this.fileAttached=true
|
||||
|
||||
return attIDs
|
||||
})
|
||||
.then((attIDs) => {
|
||||
|
@ -91,6 +81,7 @@ export default {
|
|||
.then(resp => resp.json())
|
||||
.then(file => {
|
||||
this.files = file.data
|
||||
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -4,7 +4,10 @@
|
|||
<div v-html="content"></div>
|
||||
</div>
|
||||
<div v-else class="text-center font-bold text-4xl font-smooth py-16 text-gray-600 ">
|
||||
404 | Page Not Found!
|
||||
loading
|
||||
</div>
|
||||
<div v-if="fileAttached">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -16,13 +19,56 @@ export default {
|
|||
attachment:null,
|
||||
content:null,
|
||||
isLoading: true,
|
||||
files:null,
|
||||
fileAttached:false
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
|
||||
let path=window.location.pathname.split('/');
|
||||
console.log(path[1]);
|
||||
// console.log(path[1]);
|
||||
if(path[1]==='notice' || path[1]==='documents' ){
|
||||
let queryP='https://api8.siliconpin.com/items/scc22?filter[type][_eq]=notice&filter[slug][_eq]='+path[2];
|
||||
fetch(queryP)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
this.page = data.data[0]
|
||||
this.content = this.page.content
|
||||
this.file = this.page.attachments
|
||||
// console.log(this.file)
|
||||
this.isLoading = false
|
||||
return this.page.id
|
||||
})
|
||||
.then((pageID) => {
|
||||
fetch('https://api8.siliconpin.com/items/scc22_files_1?filter[scc22_id][_in]=' + pageID)
|
||||
.then(resp => resp.json())
|
||||
.then(file => {
|
||||
// console.log(file)
|
||||
let attIDs = ''
|
||||
let t = 0
|
||||
file.data.forEach(ids => {
|
||||
if (t == 0) attIDs = ids.directus_files_id
|
||||
else attIDs = attIDs + ',' + ids.directus_files_id
|
||||
t++
|
||||
});
|
||||
if(t>0) this.fileAttached=true
|
||||
return attIDs
|
||||
})
|
||||
.then((attIDs) => {
|
||||
fetch('https://api8.siliconpin.com/files?filter[id][_in]=' + attIDs)
|
||||
.then(resp => resp.json())
|
||||
.then(file => {
|
||||
this.files = file.data
|
||||
console.log(this.files)
|
||||
})
|
||||
})
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error)
|
||||
});
|
||||
}
|
||||
|
||||
else{
|
||||
// fetch('https://api8.siliconpin.com/items/scc22?filter[type][_eq]=notice&limit=-1')
|
||||
let queryP='https://api8.siliconpin.com/items/scc22?filter[slug][_eq]='+path[1];
|
||||
fetch(queryP)
|
||||
|
@ -34,5 +80,7 @@ export default {
|
|||
this.isLoading = false
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -17,6 +17,7 @@ const { title } = Astro.props;
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<script src="/js/inc.js" defer></script>
|
||||
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9252259454702469" crossorigin="anonymous"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -5,18 +5,6 @@ import MainMenu from "../../components/MainMenu.astro"
|
|||
import Footer from "../../components/Footer.astro"
|
||||
import NoticeIDPage from "../../components/NoticeIDPage.vue"
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const response = await fetch('https://api8.siliconpin.com/items/scc22?filter[status][_eq]=published&filter[type][_eq]=notice');
|
||||
const data = await response.json();
|
||||
const finalData = data.data.map((n: { slug: string | undefined; })=>{
|
||||
return {params: {id:n.slug}}
|
||||
})
|
||||
return finalData;
|
||||
}
|
||||
const response = await fetch('https://api8.siliconpin.com/items/scc22?filter[status][_eq]=published&filter[type][_eq]=notice');
|
||||
const data = await response.json();
|
||||
const { id } = Astro.params;
|
||||
const idx = data.data.findIndex((n: { slug: string | undefined; }) => n.slug ===id);
|
||||
|
||||
---
|
||||
<Layout title="">
|
|
@ -32,4 +32,3 @@ import NoticePage from "../../components/NoticePage.vue"
|
|||
<Footer />
|
||||
</Layout>
|
||||
|
||||
|
Loading…
Reference in New Issue