generated from dwd/boilarplate-astro-tailwind
29 lines
1.2 KiB
Plaintext
29 lines
1.2 KiB
Plaintext
---
|
|
import Layout from "../../../layouts/Layout.astro"
|
|
import BNCategory from "../../../components/BNCategory.vue";
|
|
const postData = { key1: 'value1', key2: 'value2'};
|
|
const options = { method: 'POST', headers: { 'Content-Type': 'application/json', 'Origin': 'https://2024.dev2-cs.siliconpin.com' }, body: JSON.stringify(postData)};
|
|
const response = await fetch('https://apisp.dev2.cicdhosting.com/_dedicated/dwd/get-news/?action=news_en', options);
|
|
const data = await response.json();
|
|
const news = data;
|
|
// console.log(news);
|
|
---
|
|
<Layout title="">
|
|
<main>
|
|
<div>
|
|
<section class="container mx-auto px-4">
|
|
<div class="text-[#780a0a] py-6 flex flex-row" id="">
|
|
<a id="folder" href="/en"></a> >
|
|
<p id="cat"></p>
|
|
</div>
|
|
<BNCategory client:visible />
|
|
</section>
|
|
</div>
|
|
</main>
|
|
</Layout>
|
|
<script is:inline>
|
|
let fullURL = window.location.href.split('/');
|
|
// console.log(fullURL);
|
|
let folderName = document.getElementById('folder').innerHTML = fullURL[3];
|
|
let catName = document.getElementById('cat').innerHTML = fullURL[5].split('?cat=')[1]
|
|
</script> |