Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7d8fcce2e1 | |||
| df9c40847d | |||
| c1c57c4f85 | |||
| 809f89af08 | |||
| f2d943c31b | |||
| d8a79ccbe3 | |||
| c5e0b009ca | |||
| 0caf91fc0e |
@@ -0,0 +1,12 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
trim_trailing_whitespace = false
|
||||||
@@ -22,3 +22,6 @@ pnpm-debug.log*
|
|||||||
|
|
||||||
# jetbrains setting folder
|
# jetbrains setting folder
|
||||||
.idea/
|
.idea/
|
||||||
|
|
||||||
|
# local data (view counter SQLite)
|
||||||
|
data/
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
dist/
|
||||||
|
.astro/
|
||||||
|
node_modules/
|
||||||
|
package-lock.json
|
||||||
|
docs/
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"singleQuote": true,
|
||||||
|
"printWidth": 100,
|
||||||
|
"plugins": ["prettier-plugin-astro", "prettier-plugin-tailwindcss"],
|
||||||
|
"tailwindStylesheet": "./src/styles/global.css",
|
||||||
|
"overrides": [{ "files": "*.astro", "options": { "parser": "astro" } }]
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# ta1sph.info — Claude Code Proje Talimatları
|
||||||
|
|
||||||
|
Bu dosya Claude Code tarafından her oturumda otomatik okunur.
|
||||||
|
|
||||||
|
- Proje: Suphi Çakır (TA1SPH) amatör telsizcilik Blog & Portfolio sitesi — Astro + TailwindCSS, Dokploy ile `https://ta1sph.info`.
|
||||||
|
- Tüm işler için **`ta1sph-site` skill'ini** kullan (kullanıcı düzeyinde yüklü; repoda kopyası yok).
|
||||||
|
- Astro CLI / dev server kuralları: @AGENTS.md
|
||||||
|
- Komutlar: **Siteyi Kur · Makale Ekle · Makale Düzenle · Uygulama Düzenle · Yayına Al · Hafızayı Güncelle**
|
||||||
|
- Kullanıcıyla Türkçe konuş; kod/commit İngilizce.
|
||||||
|
- **Projeyi baştan tarama.** Önce aşağıdaki proje hafızasını oku, sadece görevin gerektirdiği dosyaları aç.
|
||||||
|
- Her görevin sonunda `PROJECT_MEMORY.md` dosyasını güncelle (skill Bölüm 5).
|
||||||
|
|
||||||
|
## Proje hafızası
|
||||||
|
|
||||||
|
@PROJECT_MEMORY.md
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2026 Suphi Çakır (TA1SPH)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
@@ -0,0 +1,442 @@
|
|||||||
|
The articles, images and other content of ta1sph.info (everything under
|
||||||
|
src/content/ and the texts in src/data/) are © Suphi Çakır (TA1SPH) and licensed
|
||||||
|
under the Creative Commons Attribution-ShareAlike 4.0 International License
|
||||||
|
(CC BY-SA 4.0): https://creativecommons.org/licenses/by-sa/4.0/
|
||||||
|
|
||||||
|
Attribution: "Suphi Çakır – TA1SPH, ta1sph.info" + a link to the original page.
|
||||||
|
|
||||||
|
Third-party logos, trademarks and externally sourced images remain under their
|
||||||
|
owners' licenses. The source code is licensed separately under MIT (see LICENSE).
|
||||||
|
|
||||||
|
The full legal code follows (source: creativecommons.org/licenses/by-sa/4.0/legalcode.txt).
|
||||||
|
|
||||||
|
=======================================================================
|
||||||
|
|
||||||
|
Attribution-ShareAlike 4.0 International
|
||||||
|
|
||||||
|
=======================================================================
|
||||||
|
|
||||||
|
Creative Commons Corporation ("Creative Commons") is not a law firm and
|
||||||
|
does not provide legal services or legal advice. Distribution of
|
||||||
|
Creative Commons public licenses does not create a lawyer-client or
|
||||||
|
other relationship. Creative Commons makes its licenses and related
|
||||||
|
information available on an "as-is" basis. Creative Commons gives no
|
||||||
|
warranties regarding its licenses, any material licensed under their
|
||||||
|
terms and conditions, or any related information. Creative Commons
|
||||||
|
disclaims all liability for damages resulting from their use to the
|
||||||
|
fullest extent possible.
|
||||||
|
|
||||||
|
Using Creative Commons Public Licenses
|
||||||
|
|
||||||
|
Creative Commons public licenses provide a standard set of terms and
|
||||||
|
conditions that creators and other rights holders may use to share
|
||||||
|
original works of authorship and other material subject to copyright
|
||||||
|
and certain other rights specified in the public license below. The
|
||||||
|
following considerations are for informational purposes only, are not
|
||||||
|
exhaustive, and do not form part of our licenses.
|
||||||
|
|
||||||
|
Considerations for licensors: Our public licenses are
|
||||||
|
intended for use by those authorized to give the public
|
||||||
|
permission to use material in ways otherwise restricted by
|
||||||
|
copyright and certain other rights. Our licenses are
|
||||||
|
irrevocable. Licensors should read and understand the terms
|
||||||
|
and conditions of the license they choose before applying it.
|
||||||
|
Licensors should also secure all rights necessary before
|
||||||
|
applying our licenses so that the public can reuse the
|
||||||
|
material as expected. Licensors should clearly mark any
|
||||||
|
material not subject to the license. This includes other CC-
|
||||||
|
licensed material, or material used under an exception or
|
||||||
|
limitation to copyright. More considerations for licensors:
|
||||||
|
wiki.creativecommons.org/Considerations_for_licensors
|
||||||
|
|
||||||
|
Considerations for the public: By using one of our public
|
||||||
|
licenses, a licensor grants the public permission to use the
|
||||||
|
licensed material under specified terms and conditions. If
|
||||||
|
the licensor's permission is not necessary for any reason--for
|
||||||
|
example, because of any applicable exception or limitation to
|
||||||
|
copyright--then that use is not regulated by the license. Our
|
||||||
|
licenses grant only permissions under copyright and certain
|
||||||
|
other rights that a licensor has authority to grant. Use of
|
||||||
|
the licensed material may still be restricted for other
|
||||||
|
reasons, including because others have copyright or other
|
||||||
|
rights in the material. A licensor may make special requests,
|
||||||
|
such as asking that all changes be marked or described.
|
||||||
|
Although not required by our licenses, you are encouraged to
|
||||||
|
respect those requests where reasonable. More considerations
|
||||||
|
for the public:
|
||||||
|
wiki.creativecommons.org/Considerations_for_licensees
|
||||||
|
|
||||||
|
=======================================================================
|
||||||
|
|
||||||
|
Creative Commons Attribution-ShareAlike 4.0 International Public
|
||||||
|
License
|
||||||
|
|
||||||
|
By exercising the Licensed Rights (defined below), You accept and agree
|
||||||
|
to be bound by the terms and conditions of this Creative Commons
|
||||||
|
Attribution-ShareAlike 4.0 International Public License ("Public
|
||||||
|
License"). To the extent this Public License may be interpreted as a
|
||||||
|
contract, You are granted the Licensed Rights in consideration of Your
|
||||||
|
acceptance of these terms and conditions, and the Licensor grants You
|
||||||
|
such rights in consideration of benefits the Licensor receives from
|
||||||
|
making the Licensed Material available under these terms and
|
||||||
|
conditions.
|
||||||
|
|
||||||
|
|
||||||
|
Section 1 -- Definitions.
|
||||||
|
|
||||||
|
a. Adapted Material means material subject to Copyright and Similar
|
||||||
|
Rights that is derived from or based upon the Licensed Material
|
||||||
|
and in which the Licensed Material is translated, altered,
|
||||||
|
arranged, transformed, or otherwise modified in a manner requiring
|
||||||
|
permission under the Copyright and Similar Rights held by the
|
||||||
|
Licensor. For purposes of this Public License, where the Licensed
|
||||||
|
Material is a musical work, performance, or sound recording,
|
||||||
|
Adapted Material is always produced where the Licensed Material is
|
||||||
|
synched in timed relation with a moving image.
|
||||||
|
|
||||||
|
b. Adapter's License means the license You apply to Your Copyright
|
||||||
|
and Similar Rights in Your contributions to Adapted Material in
|
||||||
|
accordance with the terms and conditions of this Public License.
|
||||||
|
|
||||||
|
c. BY-SA Compatible License means a license listed at
|
||||||
|
creativecommons.org/compatiblelicenses, approved by Creative
|
||||||
|
Commons as essentially the equivalent of this Public License.
|
||||||
|
|
||||||
|
d. Copyright and Similar Rights means copyright and/or similar rights
|
||||||
|
closely related to copyright including, without limitation,
|
||||||
|
performance, broadcast, sound recording, and Sui Generis Database
|
||||||
|
Rights, without regard to how the rights are labeled or
|
||||||
|
categorized. For purposes of this Public License, the rights
|
||||||
|
specified in Section 2(b)(1)-(2) are not Copyright and Similar
|
||||||
|
Rights.
|
||||||
|
|
||||||
|
e. Effective Technological Measures means those measures that, in the
|
||||||
|
absence of proper authority, may not be circumvented under laws
|
||||||
|
fulfilling obligations under Article 11 of the WIPO Copyright
|
||||||
|
Treaty adopted on December 20, 1996, and/or similar international
|
||||||
|
agreements.
|
||||||
|
|
||||||
|
f. Exceptions and Limitations means fair use, fair dealing, and/or
|
||||||
|
any other exception or limitation to Copyright and Similar Rights
|
||||||
|
that applies to Your use of the Licensed Material.
|
||||||
|
|
||||||
|
g. License Elements means the license attributes listed in the name
|
||||||
|
of a Creative Commons Public License. The License Elements of this
|
||||||
|
Public License are Attribution and ShareAlike.
|
||||||
|
|
||||||
|
h. Licensed Material means the artistic or literary work, database,
|
||||||
|
or other material to which the Licensor applied this Public
|
||||||
|
License.
|
||||||
|
|
||||||
|
i. Licensed Rights means the rights granted to You subject to the
|
||||||
|
terms and conditions of this Public License, which are limited to
|
||||||
|
all Copyright and Similar Rights that apply to Your use of the
|
||||||
|
Licensed Material and that the Licensor has authority to license.
|
||||||
|
|
||||||
|
j. Licensor means the individual(s) or entity(ies) granting rights
|
||||||
|
under this Public License.
|
||||||
|
|
||||||
|
k. Share means to provide material to the public by any means or
|
||||||
|
process that requires permission under the Licensed Rights, such
|
||||||
|
as reproduction, public display, public performance, distribution,
|
||||||
|
dissemination, communication, or importation, and to make material
|
||||||
|
available to the public including in ways that members of the
|
||||||
|
public may access the material from a place and at a time
|
||||||
|
individually chosen by them.
|
||||||
|
|
||||||
|
l. Sui Generis Database Rights means rights other than copyright
|
||||||
|
resulting from Directive 96/9/EC of the European Parliament and of
|
||||||
|
the Council of 11 March 1996 on the legal protection of databases,
|
||||||
|
as amended and/or succeeded, as well as other essentially
|
||||||
|
equivalent rights anywhere in the world.
|
||||||
|
|
||||||
|
m. You means the individual or entity exercising the Licensed Rights
|
||||||
|
under this Public License. Your has a corresponding meaning.
|
||||||
|
|
||||||
|
|
||||||
|
Section 2 -- Scope.
|
||||||
|
|
||||||
|
a. License grant.
|
||||||
|
|
||||||
|
1. Subject to the terms and conditions of this Public License,
|
||||||
|
the Licensor hereby grants You a worldwide, royalty-free,
|
||||||
|
non-sublicensable, non-exclusive, irrevocable license to
|
||||||
|
exercise the Licensed Rights in the Licensed Material to:
|
||||||
|
|
||||||
|
a. reproduce and Share the Licensed Material, in whole or
|
||||||
|
in part; and
|
||||||
|
|
||||||
|
b. produce, reproduce, and Share Adapted Material.
|
||||||
|
|
||||||
|
2. Exceptions and Limitations. For the avoidance of doubt, where
|
||||||
|
Exceptions and Limitations apply to Your use, this Public
|
||||||
|
License does not apply, and You do not need to comply with
|
||||||
|
its terms and conditions.
|
||||||
|
|
||||||
|
3. Term. The term of this Public License is specified in Section
|
||||||
|
6(a).
|
||||||
|
|
||||||
|
4. Media and formats; technical modifications allowed. The
|
||||||
|
Licensor authorizes You to exercise the Licensed Rights in
|
||||||
|
all media and formats whether now known or hereafter created,
|
||||||
|
and to make technical modifications necessary to do so. The
|
||||||
|
Licensor waives and/or agrees not to assert any right or
|
||||||
|
authority to forbid You from making technical modifications
|
||||||
|
necessary to exercise the Licensed Rights, including
|
||||||
|
technical modifications necessary to circumvent Effective
|
||||||
|
Technological Measures. For purposes of this Public License,
|
||||||
|
simply making modifications authorized by this Section 2(a)
|
||||||
|
(4) never produces Adapted Material.
|
||||||
|
|
||||||
|
5. Downstream recipients.
|
||||||
|
|
||||||
|
a. Offer from the Licensor -- Licensed Material. Every
|
||||||
|
recipient of the Licensed Material automatically
|
||||||
|
receives an offer from the Licensor to exercise the
|
||||||
|
Licensed Rights under the terms and conditions of this
|
||||||
|
Public License.
|
||||||
|
|
||||||
|
b. Additional offer from the Licensor -- Adapted Material.
|
||||||
|
Every recipient of Adapted Material from You
|
||||||
|
automatically receives an offer from the Licensor to
|
||||||
|
exercise the Licensed Rights in the Adapted Material
|
||||||
|
under the conditions of the Adapter's License You apply.
|
||||||
|
|
||||||
|
c. No downstream restrictions. You may not offer or impose
|
||||||
|
any additional or different terms or conditions on, or
|
||||||
|
apply any Effective Technological Measures to, the
|
||||||
|
Licensed Material if doing so restricts exercise of the
|
||||||
|
Licensed Rights by any recipient of the Licensed
|
||||||
|
Material.
|
||||||
|
|
||||||
|
6. No endorsement. Nothing in this Public License constitutes or
|
||||||
|
may be construed as permission to assert or imply that You
|
||||||
|
are, or that Your use of the Licensed Material is, connected
|
||||||
|
with, or sponsored, endorsed, or granted official status by,
|
||||||
|
the Licensor or others designated to receive attribution as
|
||||||
|
provided in Section 3(a)(1)(A)(i).
|
||||||
|
|
||||||
|
b. Other rights.
|
||||||
|
|
||||||
|
1. Moral rights, such as the right of integrity, are not
|
||||||
|
licensed under this Public License, nor are publicity,
|
||||||
|
privacy, and/or other similar personality rights; however, to
|
||||||
|
the extent possible, the Licensor waives and/or agrees not to
|
||||||
|
assert any such rights held by the Licensor to the limited
|
||||||
|
extent necessary to allow You to exercise the Licensed
|
||||||
|
Rights, but not otherwise.
|
||||||
|
|
||||||
|
2. Patent and trademark rights are not licensed under this
|
||||||
|
Public License.
|
||||||
|
|
||||||
|
3. To the extent possible, the Licensor waives any right to
|
||||||
|
collect royalties from You for the exercise of the Licensed
|
||||||
|
Rights, whether directly or through a collecting society
|
||||||
|
under any voluntary or waivable statutory or compulsory
|
||||||
|
licensing scheme. In all other cases the Licensor expressly
|
||||||
|
reserves any right to collect such royalties.
|
||||||
|
|
||||||
|
|
||||||
|
Section 3 -- License Conditions.
|
||||||
|
|
||||||
|
Your exercise of the Licensed Rights is expressly made subject to the
|
||||||
|
following conditions.
|
||||||
|
|
||||||
|
a. Attribution.
|
||||||
|
|
||||||
|
1. If You Share the Licensed Material (including in modified
|
||||||
|
form), You must:
|
||||||
|
|
||||||
|
a. retain the following if it is supplied by the Licensor
|
||||||
|
with the Licensed Material:
|
||||||
|
|
||||||
|
i. identification of the creator(s) of the Licensed
|
||||||
|
Material and any others designated to receive
|
||||||
|
attribution, in any reasonable manner requested by
|
||||||
|
the Licensor (including by pseudonym if
|
||||||
|
designated);
|
||||||
|
|
||||||
|
ii. a copyright notice;
|
||||||
|
|
||||||
|
iii. a notice that refers to this Public License;
|
||||||
|
|
||||||
|
iv. a notice that refers to the disclaimer of
|
||||||
|
warranties;
|
||||||
|
|
||||||
|
v. a URI or hyperlink to the Licensed Material to the
|
||||||
|
extent reasonably practicable;
|
||||||
|
|
||||||
|
b. indicate if You modified the Licensed Material and
|
||||||
|
retain an indication of any previous modifications; and
|
||||||
|
|
||||||
|
c. indicate the Licensed Material is licensed under this
|
||||||
|
Public License, and include the text of, or the URI or
|
||||||
|
hyperlink to, this Public License.
|
||||||
|
|
||||||
|
2. You may satisfy the conditions in Section 3(a)(1) in any
|
||||||
|
reasonable manner based on the medium, means, and context in
|
||||||
|
which You Share the Licensed Material. For example, it may be
|
||||||
|
reasonable to satisfy the conditions by providing a URI or
|
||||||
|
hyperlink to a resource that includes the required
|
||||||
|
information.
|
||||||
|
|
||||||
|
3. If requested by the Licensor, You must remove any of the
|
||||||
|
information required by Section 3(a)(1)(A) to the extent
|
||||||
|
reasonably practicable.
|
||||||
|
|
||||||
|
b. ShareAlike.
|
||||||
|
|
||||||
|
In addition to the conditions in Section 3(a), if You Share
|
||||||
|
Adapted Material You produce, the following conditions also apply.
|
||||||
|
|
||||||
|
1. The Adapter's License You apply must be a Creative Commons
|
||||||
|
license with the same License Elements, this version or
|
||||||
|
later, or a BY-SA Compatible License.
|
||||||
|
|
||||||
|
2. You must include the text of, or the URI or hyperlink to, the
|
||||||
|
Adapter's License You apply. You may satisfy this condition
|
||||||
|
in any reasonable manner based on the medium, means, and
|
||||||
|
context in which You Share Adapted Material.
|
||||||
|
|
||||||
|
3. You may not offer or impose any additional or different terms
|
||||||
|
or conditions on, or apply any Effective Technological
|
||||||
|
Measures to, Adapted Material that restrict exercise of the
|
||||||
|
rights granted under the Adapter's License You apply.
|
||||||
|
|
||||||
|
|
||||||
|
Section 4 -- Sui Generis Database Rights.
|
||||||
|
|
||||||
|
Where the Licensed Rights include Sui Generis Database Rights that
|
||||||
|
apply to Your use of the Licensed Material:
|
||||||
|
|
||||||
|
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
|
||||||
|
to extract, reuse, reproduce, and Share all or a substantial
|
||||||
|
portion of the contents of the database;
|
||||||
|
|
||||||
|
b. if You include all or a substantial portion of the database
|
||||||
|
contents in a database in which You have Sui Generis Database
|
||||||
|
Rights, then the database in which You have Sui Generis Database
|
||||||
|
Rights (but not its individual contents) is Adapted Material,
|
||||||
|
including for purposes of Section 3(b); and
|
||||||
|
|
||||||
|
c. You must comply with the conditions in Section 3(a) if You Share
|
||||||
|
all or a substantial portion of the contents of the database.
|
||||||
|
|
||||||
|
For the avoidance of doubt, this Section 4 supplements and does not
|
||||||
|
replace Your obligations under this Public License where the Licensed
|
||||||
|
Rights include other Copyright and Similar Rights.
|
||||||
|
|
||||||
|
|
||||||
|
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
|
||||||
|
|
||||||
|
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
|
||||||
|
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
|
||||||
|
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
|
||||||
|
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
|
||||||
|
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
|
||||||
|
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
|
||||||
|
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
|
||||||
|
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
|
||||||
|
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
|
||||||
|
|
||||||
|
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
|
||||||
|
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
|
||||||
|
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
|
||||||
|
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
|
||||||
|
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
|
||||||
|
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
|
||||||
|
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
|
||||||
|
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
|
||||||
|
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
|
||||||
|
|
||||||
|
c. The disclaimer of warranties and limitation of liability provided
|
||||||
|
above shall be interpreted in a manner that, to the extent
|
||||||
|
possible, most closely approximates an absolute disclaimer and
|
||||||
|
waiver of all liability.
|
||||||
|
|
||||||
|
|
||||||
|
Section 6 -- Term and Termination.
|
||||||
|
|
||||||
|
a. This Public License applies for the term of the Copyright and
|
||||||
|
Similar Rights licensed here. However, if You fail to comply with
|
||||||
|
this Public License, then Your rights under this Public License
|
||||||
|
terminate automatically.
|
||||||
|
|
||||||
|
b. Where Your right to use the Licensed Material has terminated under
|
||||||
|
Section 6(a), it reinstates:
|
||||||
|
|
||||||
|
1. automatically as of the date the violation is cured, provided
|
||||||
|
it is cured within 30 days of Your discovery of the
|
||||||
|
violation; or
|
||||||
|
|
||||||
|
2. upon express reinstatement by the Licensor.
|
||||||
|
|
||||||
|
For the avoidance of doubt, this Section 6(b) does not affect any
|
||||||
|
right the Licensor may have to seek remedies for Your violations
|
||||||
|
of this Public License.
|
||||||
|
|
||||||
|
c. For the avoidance of doubt, the Licensor may also offer the
|
||||||
|
Licensed Material under separate terms or conditions or stop
|
||||||
|
distributing the Licensed Material at any time; however, doing so
|
||||||
|
will not terminate this Public License.
|
||||||
|
|
||||||
|
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
|
||||||
|
License.
|
||||||
|
|
||||||
|
|
||||||
|
Section 7 -- Other Terms and Conditions.
|
||||||
|
|
||||||
|
a. The Licensor shall not be bound by any additional or different
|
||||||
|
terms or conditions communicated by You unless expressly agreed.
|
||||||
|
|
||||||
|
b. Any arrangements, understandings, or agreements regarding the
|
||||||
|
Licensed Material not stated herein are separate from and
|
||||||
|
independent of the terms and conditions of this Public License.
|
||||||
|
|
||||||
|
|
||||||
|
Section 8 -- Interpretation.
|
||||||
|
|
||||||
|
a. For the avoidance of doubt, this Public License does not, and
|
||||||
|
shall not be interpreted to, reduce, limit, restrict, or impose
|
||||||
|
conditions on any use of the Licensed Material that could lawfully
|
||||||
|
be made without permission under this Public License.
|
||||||
|
|
||||||
|
b. To the extent possible, if any provision of this Public License is
|
||||||
|
deemed unenforceable, it shall be automatically reformed to the
|
||||||
|
minimum extent necessary to make it enforceable. If the provision
|
||||||
|
cannot be reformed, it shall be severed from this Public License
|
||||||
|
without affecting the enforceability of the remaining terms and
|
||||||
|
conditions.
|
||||||
|
|
||||||
|
c. No term or condition of this Public License will be waived and no
|
||||||
|
failure to comply consented to unless expressly agreed to by the
|
||||||
|
Licensor.
|
||||||
|
|
||||||
|
d. Nothing in this Public License constitutes or may be interpreted
|
||||||
|
as a limitation upon, or waiver of, any privileges and immunities
|
||||||
|
that apply to the Licensor or You, including from the legal
|
||||||
|
processes of any jurisdiction or authority.
|
||||||
|
|
||||||
|
|
||||||
|
=======================================================================
|
||||||
|
|
||||||
|
Creative Commons is not a party to its public
|
||||||
|
licenses. Notwithstanding, Creative Commons may elect to apply one of
|
||||||
|
its public licenses to material it publishes and in those instances
|
||||||
|
will be considered the “Licensor.” The text of the Creative Commons
|
||||||
|
public licenses is dedicated to the public domain under the CC0 Public
|
||||||
|
Domain Dedication. Except for the limited purpose of indicating that
|
||||||
|
material is shared under a Creative Commons public license or as
|
||||||
|
otherwise permitted by the Creative Commons policies published at
|
||||||
|
creativecommons.org/policies, Creative Commons does not authorize the
|
||||||
|
use of the trademark "Creative Commons" or any other trademark or logo
|
||||||
|
of Creative Commons without its prior written consent including,
|
||||||
|
without limitation, in connection with any unauthorized modifications
|
||||||
|
to any of its public licenses or any other arrangements,
|
||||||
|
understandings, or agreements concerning use of licensed material. For
|
||||||
|
the avoidance of doubt, this paragraph does not form part of the
|
||||||
|
public licenses.
|
||||||
|
|
||||||
|
Creative Commons may be contacted at creativecommons.org.
|
||||||
|
|
||||||
@@ -0,0 +1,111 @@
|
|||||||
|
# PROJECT_MEMORY — ta1sph.info
|
||||||
|
|
||||||
|
> Claude'un bu proje için kalıcı hafızası. Her görev sonunda güncellenir. Kısa ve güncel tutulur.
|
||||||
|
> Son güncelleme: 2026-10-16 · Güncelleyen: Claude (Siteyi Kur — Aşama 7)
|
||||||
|
|
||||||
|
## 1. Durum
|
||||||
|
|
||||||
|
- **Aşama:** 7 tamamlandı (kalite). Sıradaki: **Aşama 8 — Deploy hazırlığı**.
|
||||||
|
- **Tamamlanan:** Aşama 0–7. Stil önizleme yalnızca dev'de: `http://localhost:4321/styleguide/`. Lighthouse (mobil, 3 koşu ortancası, yerel): A11y/BP/SEO 100 her sayfada; Perf temiz koşullarda 98–100, LCP ~1,4–1,9 sn. Yayında PageSpeed Insights ile doğrulanmalı.
|
||||||
|
- **Açık işler:** Aşama 8. Node sunucusu yanıtları sıkıştırmıyor → A8'de Traefik `compress` middleware veya eşdeğeri şart. 3 örnek yazı (`örnek` etiketli) kullanıcı isteyince silinecek. Hakkımda tanıtım paragrafı kullanıcı metin verirse.
|
||||||
|
- **Bilinen sorunlar:** Arama (Pagefind) `astro dev`'de çalışmaz, yalnızca build sonrası. Kullanıcının elle başlattığı dev sunucusu yeni koleksiyonu görmüyorsa yeniden başlatılmalı. `npm audit`: 2 orta seviye (postcss-selector-parser 6.0.10, @tailwindcss/typography sabitliyor) — yalnızca build zamanı, düzeltme typography'yi eski sürüme düşürdüğü için uygulanmadı.
|
||||||
|
|
||||||
|
## 2. Ortam
|
||||||
|
|
||||||
|
- Astro 7.4.0 · TailwindCSS 4.3.3 (`@tailwindcss/vite`) · TypeScript 6 strict · zod = `astro/zod` (ayrı paket yok)
|
||||||
|
- @astrojs/node 11.1.8 · mdx 8.1.0 · sitemap 3.7.4 · rss 4.0.19 · astro-icon 1.2.0 · pagefind 1.5.2
|
||||||
|
- Yerel: Node v26.11.1, npm 12.2.0, Docker 29.8.1 · `package.json` engines: node >=22.22
|
||||||
|
- Repo: yerel git (Gitea remote henüz yok; push yalnızca kullanıcı onayıyla) · Branch: `main`
|
||||||
|
- Canlı: https://ta1sph.info (Dokploy, HomeServer Atlas) — _henüz yayında değil_
|
||||||
|
|
||||||
|
## 3. Dosya Haritası
|
||||||
|
|
||||||
|
- `astro.config.mjs` — site/trailingSlash/static + node adapter, mdx, sitemap (`/_styleguide/` hariç), astro-icon (tabler), Tailwind vite plugin
|
||||||
|
- `src/styles/global.css` — tema token'ları (light/dark, `data-theme`), fontlar, `.surface-alt` (khaki bölüm), `.headline`, `.link-strong`, reduced-motion
|
||||||
|
- `src/data/site.json` (ad, açıklama, nav, footer, `ui` metinleri, postsPerPage) · `src/data/social.json` (boş `href` → gizli) · `src/lib/data.ts` (zod; hata build'i kırar)
|
||||||
|
- `src/layouts/BaseLayout.astro` — head (ThemeInit, Seo, RSS alternate), skip link, Header, `main#main`, Footer
|
||||||
|
- `src/components/` — `Seo` (title/desc/canonical/OG/Twitter + WebSite/Person JSON-LD graph, `jsonLd` prop'u ile ek düğüm), `ThemeInit` (FOUC önleyici inline), `ThemeToggle`, `Header` (mobil menü = native `popover`, JS yok), `Footer` (4 sütun), `Container`, `GridLines`, `SectionHeading` (eyebrow + kırmızı çizgi), `Button` (primary/secondary/link), `Badge` (solid/outline/category), `Card`, `ExternalLink`
|
||||||
|
- `src/data/home.json` — `seo`, `hero`, `sections[]` (`feature` | `cards` | `latestPosts`); şema `data.ts` → `home`, `HomeSection`. Tanıtım metinleri sitelerin kendi tanıtımlarından (2026-10-16 tarandı)
|
||||||
|
- `src/pages/index.astro` — sections'ı sırayla render eder; arka plan dönüşümlü (hero khaki → paper, khaki…)
|
||||||
|
- `src/components/Section.astro` (tam genişlik bölüm + GridLines, `alt` = khaki) · `src/components/home/` — `Hero`, `FeatureSection` (numara + ikon | çağrı işareti/alan adı | başlık+metin+CTA; 3 sütun grid çizgileriyle hizalı), `CardGrid`, `LatestPosts` (slot), `Numeral` (dev rakam `::before` ile → a11y/kontrast dışı)
|
||||||
|
- `Button` — `external` prop'u (target/rel + sr-only "yeni sekmede açılır")
|
||||||
|
- `src/content.config.ts` — `blog` koleksiyonu (glob `**/index.{md,mdx}`, id = klasör adı), zod şeması (kapak varsa `coverAlt` zorunlu)
|
||||||
|
- `src/data/categories.json` (slug/ad/açıklama/ikon) · `src/data/blog.json` (blog arayüz metinleri, paylaşım URL şablonları `{url}`/`{title}`); `data.ts` → `categories`, `blog`, `fmt()`
|
||||||
|
- `src/lib/posts.ts` — `getPosts` (prod'da draft hariç, bilinmeyen kategori build'i kırar), URL yardımcıları, `readingMinutes` (body/200), tag/kategori sayımları, `featuredPosts`, `adjacentPosts`, `chunk`/`pageUrl`/`pageParam` · `src/lib/dates.ts` — `dateBadges`, `formatDate` (tr-TR, Europe/Istanbul), `isoDay`
|
||||||
|
- `src/lib/markdown-plugins.mjs` — Sätteri HAST eklentileri: `figurePlugin` (`` → figure/figcaption), `externalLinksPlugin` (dış link → yeni sekme)
|
||||||
|
- `src/pages/blog/[...page].astro` (/blog/, /blog/sayfa/n/) · `blog/[slug].astro` (detay + BlogPosting/BreadcrumbList JSON-LD, kod kopyala script'i) · `blog/kategori/[category]/[...page].astro` · `blog/etiket/[tag]/[...page].astro` · `src/pages/rss.xml.ts`
|
||||||
|
- `src/components/blog/` — `BlogListing` (liste düzeni + sidebar), `PostCard` (row/stack, kapaksızsa kategori ikonu), `DateBadges`, `Pager`, `Sidebar`, `SearchBox` (Pagefind JS API, özel UI), `ShareBar`, `Toc`, `Breadcrumbs`, `DiyNotice`
|
||||||
|
- `global.css` — `.article-prose` (prose token eşlemesi), Shiki çift tema, `.code-copy`
|
||||||
|
- `src/lib/views.ts` — `node:sqlite` sayaç (`$DATA_DIR/views.db`, varsayılan `./data`; Docker'da `/app/data` volume). Tablolar: `views(slug,count)`, `hits(hash,at)` 24 sa, `salts(day,salt)` günlük tuz. IP saklanmaz; `clientIp` önce `X-Forwarded-For`; `isBot` UA filtresi (headless dahil)
|
||||||
|
- `src/pages/api/views/[slug].ts` (POST, 204; bilinmeyen slug 404) · `src/pages/api/views/top.ts` (GET `?limit=1..10`, JSON `{slug,title,url,count}`, 5 dk cache) — ikisi `prerender = false`
|
||||||
|
- Yazı sayfası `sendBeacon('/api/views/<slug>/')`; Sidebar script'i `/api/views/top/` ile `ol[data-featured]`'ı değiştirir, eksikleri build-time yedekle tamamlar
|
||||||
|
- `src/data/about.json` (künye + ekipman grupları) · `src/data/contact.json` (harita lat/lng/zoom, bilgi satırları; `email` HTML'de açık yazılmaz, JS ile birleştirilir) · `src/data/pages.json` (yasal sayfa ortak metinleri, 404)
|
||||||
|
- `src/pages/hakkimda.astro` (ProfilePage JSON-LD) · `src/pages/iletisim.astro` (Leaflet + OSM, görünür olunca dinamik import; `divIcon` içinde `.tower-pin`) · `src/pages/[legal].astro` + `src/content/legal/{gizlilik,lisans,sorumluluk-reddi}.md` (koleksiyon `legal`, frontmatter `updated`) · `src/pages/404.astro`
|
||||||
|
- `src/components/PageHeader.astro` (khaki başlık + tek h1; blog listesi de kullanır) · `src/components/CodeCopy.astro` (Markdown'ı sarar, kod bloklarına Kopyala düğmesi)
|
||||||
|
- `LICENSE` (MIT) · `LICENSE-CONTENT` (CC BY-SA 4.0, resmî legalcode.txt'den)
|
||||||
|
- `src/lib/og.ts` — Satori + Sharp ile 1200×630 OG PNG (khaki, grid çizgileri, kule ikonu); latin-ext fontlar ayrı aile adıyla yedek (`RubikExt`, `InterExt`) · `src/pages/og/[slug].png.ts` (yazı başına) · `src/pages/og-default.png.ts` (diğer sayfalar). `Seo` varsayılanı `/og-default.png`; kapaklı yazıda kapak 1200px JPEG
|
||||||
|
- `src/pages/site.webmanifest.ts`, `src/pages/robots.txt.ts` (`/api/` kapalı, sitemap satırı) — `site.json`'dan
|
||||||
|
- `public/fonts/*.woff2` + `src/styles/fonts.css` — **üretilir:** `npm run fonts` (`scripts/subset-fonts.mjs`, subset-font; Latin+Türkçe+sembol, wght Rubik 400–900 / Inter 400–700; 188 KB → 66 KB). Kaynak `@fontsource-variable/*` (devDeps). BaseLayout iki latin dosyasını preload eder
|
||||||
|
- `public/favicon.{svg,ico}`, `apple-touch-icon.png`, `icon-192/512.png`, `icon-maskable-512.png` — **üretilir:** `npm run icons` (`scripts/generate-icons.mjs`; kırmızı zemin + siyah kule, 16px için kalın varyant)
|
||||||
|
- `scripts/check-site.mjs` — `npm run check:site` (build sonrası): tek h1, alt, title/description/canonical, tekrar eden id, iç link + anchor
|
||||||
|
- `src/dev/Styleguide.astro` — `astro.config.mjs`'deki `devRoutes` entegrasyonu ile sadece `astro dev`'de `/styleguide/` (`_` önekli sayfalar Astro'da rota olmaz)
|
||||||
|
- `src/lib/slug.ts` — Türkçe karakter dönüştürücü `slugify`
|
||||||
|
- `scripts/new-post.mjs` — `npm run new:post -- "Başlık"` → `src/content/blog/<slug>/index.md` (draft: true); `slug.ts`'yi Node type-stripping ile import eder
|
||||||
|
- `src/pages/index.astro` — geçici yer tutucu (Aşama 3'te değişecek)
|
||||||
|
- `docs/design-reference/` — Huemint Magazine ekran görüntüleri · `CLAUDE.md` → `AGENTS.md` + bu dosya
|
||||||
|
- Build: `astro build && pagefind --site dist/client` · statik çıktı `dist/client`, sunucu `dist/server/entry.mjs`
|
||||||
|
|
||||||
|
## 4. Kararlar (ADR)
|
||||||
|
|
||||||
|
| Tarih | Karar | Gerekçe |
|
||||||
|
| ---------- | ----------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| 2026-10-15 | Statik çıktı + `@astrojs/node` ile sadece `/api/views` dinamik | "Öne çıkan = en çok okunan" için sayaç gerekli; site geri kalanı statik ve hızlı |
|
||||||
|
| 2026-10-15 | Sayaç: SQLite, volume `/app/data` (sürücü: aşağıdaki 2026-10-16 kararı) | Harici servis yok, ev sunucusunda basit ve kalıcı |
|
||||||
|
| 2026-10-15 | Arama: Pagefind | Statik, sunucusuz, Türkçe destekli |
|
||||||
|
| 2026-10-15 | Harita: Leaflet + OpenStreetMap | API anahtarı / ücret yok, KVKK dostu |
|
||||||
|
| 2026-10-15 | İkonlar: astro-icon + Tabler | Tutarlı çizgi seti, anten kulesi ve marka ikonları mevcut |
|
||||||
|
| 2026-10-15 | Lisans: Kod MIT, içerik CC BY-SA 4.0 | Kaynak gösterilerek serbest kullanım talebi |
|
||||||
|
| 2026-10-15 | Kanonik alan: apex `ta1sph.info`, www → 301 | SEO tekilleştirme |
|
||||||
|
| 2026-10-15 | Fontlar self-host (Fontsource: Rubik + Inter) | Performans + gizlilik |
|
||||||
|
| 2026-10-16 | Ek token'lar: `accent-fill`/`on-accent-fill`, `accent-text` (khaki'de fg'ye döner) | Ölçüm: ink/red 4.46, red-strong/khaki 3.85 → küçük metin AA'yı geçmiyordu. Kırmızı zeminli butonlar ≥19px bold |
|
||||||
|
| 2026-10-16 | Yazı başına OG görseli build'de (Satori) — kullanıcı kararı bana bıraktı | Paylaşımlarda başlıklı kart; harici servis yok |
|
||||||
|
| 2026-10-16 | Favicon = kırmızı kare + siyah anten kulesi (Tabler) | "TA1" 16px'te okunmuyor; vurgu rengi + İletişim ikonuyla tutarlı |
|
||||||
|
| 2026-10-16 | Fontlar alt kümelenip `public/fonts`'tan; `build.inlineStylesheets: 'always'` | LCP'yi geciktiren render-blocking CSS + 190 KB font; ölçümde FCP 2,3 → ~1 sn |
|
||||||
|
| 2026-10-16 | Leaflet CSS iletisim.astro'da statik import | `inlineStylesheets: 'always'` dinamik CSS importunu 404'e düşürüyordu |
|
||||||
|
| 2026-10-16 | noindex sayfalarda canonical yok (404) | 404'ün `/404/` canonical'ı var olmayan URL'yi gösteriyordu |
|
||||||
|
| 2026-10-16 | Yasal metinler Markdown koleksiyonu (`src/content/legal`), tek dinamik rota | Uzun metin için prose; yeni yasal sayfa = yeni .md |
|
||||||
|
| 2026-10-16 | Leaflet işaretçisinde döndürme iç elemanda (`.tower-pin`) | CSS `rotate` özelliği Leaflet'in `translate3d`'sinden önce uygulanıp konumu kaydırıyordu |
|
||||||
|
| 2026-10-16 | Karanlık harita = karolara CSS `invert` filtresi | İkinci karo sağlayıcısı / API anahtarı gerekmez |
|
||||||
|
| 2026-10-16 | SQLite sürücüsü `node:sqlite` (better-sqlite3 değil) — kullanıcı onayı | Native derleme yok, ek paket yok; Node 26'da uyarısız. Docker imajı Node ≥24 olmalı (A8'de kesinleşecek) |
|
||||||
|
| 2026-10-16 | Astro `checkOrigin` açık kalıyor | Tarayıcı `Sec-Fetch-Site: same-origin` gönderir; başka sitelerden sayaç şişirme engellenir. curl testlerinde bu başlık eklenmeli |
|
||||||
|
| 2026-10-16 | Astro 7 Markdown = Sätteri; eklentiler `markdown.processor: satteri({ hastPlugins })` | remark/rehype eklentileri bu işlemcide çalışmaz |
|
||||||
|
| 2026-10-16 | Okuma süresi `post.body` kelime sayısından (remark eklentisi yok) | Liste sayfalarında `render()` gerekmez, Sätteri'de remark yok |
|
||||||
|
| 2026-10-16 | Sayfalama `[...page]` + `sayfa/<n>` (Astro `paginate()` değil) | Spec URL'leri `/blog/sayfa/n/`; tek dosyada 1. sayfa + diğerleri |
|
||||||
|
| 2026-10-16 | Arama UI'ı kendi bileşenimiz (Pagefind JS API), indeks yalnızca `data-pagefind-body` (yazı gövdeleri) | Tasarımla uyum, Türkçe metinler JSON'da |
|
||||||
|
| 2026-10-16 | Shiki `github-*-high-contrast`, zemin `--surface` | Kod renkleri AA kontrastı |
|
||||||
|
| 2026-10-16 | Dekoratif dev rakamlar CSS `::before` içeriği | axe/Lighthouse aria-hidden metinde bile kontrast hatası veriyordu |
|
||||||
|
| 2026-10-16 | Kuruluş/site tanıtımları yalnızca sitelerin kendi ifadelerinden | Uydurma bilgi yok; Telegram kartlarında açıklama yok (doğrulanmadı) |
|
||||||
|
| 2026-10-16 | Mobil menü native `popover` | Escape/odak/light-dismiss JS'siz |
|
||||||
|
| 2026-10-16 | Pagefind CLI postbuild (`astro-pagefind` yok) | Daha az bağımlılık; node adapter çıktısı `dist/client` |
|
||||||
|
| 2026-10-16 | Skill repoya kopyalanmadı, kullanıcı düzeyinde | Çift kopya senkron riski |
|
||||||
|
| 2026-10-15 | Locator KN41KB99HW → 41.08307 N, 28.91094 E | Harita merkezi |
|
||||||
|
|
||||||
|
## 5. İçerik Envanteri
|
||||||
|
|
||||||
|
| Slug | Başlık | Kategori | Oluşturma | Güncelleme | Durum |
|
||||||
|
| ------------------------------ | ----------------------------------------------------- | -------- | ---------- | ---------- | -------------------------- |
|
||||||
|
| dmr-temel-kavramlar | DMR'ye Giriş: Talkgroup, Timeslot ve Color Code | dmr | 2026-10-01 | — | yayında · örnek · featured |
|
||||||
|
| roleler-ve-ctcss-tonu | Röle Kullanırken CTCSS Tonu Neden Gerekli? | roleler | 2026-10-08 | 2026-10-15 | yayında · örnek |
|
||||||
|
| uhf-ground-plane-anten-mantigi | UHF Ground Plane Anten: Çalışma Mantığı ve Boy Hesabı | antenler | 2026-10-14 | — | yayında · örnek · diy |
|
||||||
|
|
||||||
|
## 6. Değişiklik Günlüğü (en yeni üstte)
|
||||||
|
|
||||||
|
- 2026-10-16 | Siteyi Kur A7 | OG görselleri (yazı başına + varsayılan), favicon seti + manifest, robots.txt, font alt kümeleme + preload, CSS inline, site denetim script'i, Lighthouse | `src/lib/og.ts`, `src/pages/{og,og-default.png,robots.txt,site.webmanifest}*`, `scripts/{generate-icons,subset-fonts,check-site}.mjs`, `public/`, `src/styles/fonts.css`, `Seo.astro`, `BaseLayout.astro`, `astro.config.mjs`
|
||||||
|
- 2026-10-16 | Siteyi Kur A6 | Hakkımda, İletişim (Leaflet harita, gizlenmiş e-posta), Gizlilik/Lisans/Sorumluluk Reddi, 404, LICENSE dosyaları; PageHeader + CodeCopy ortak bileşenleri; axe temiz | `src/pages/{hakkimda,iletisim,[legal],404}.astro`, `src/content/legal/`, `src/data/{about,contact,pages}.json`, `src/components/{PageHeader,CodeCopy,Card}.astro`, `LICENSE*`, `global.css`
|
||||||
|
- 2026-10-16 | Siteyi Kur A5 | Görüntülenme sayacı (node:sqlite, anonim, 24 sa tekil, bot filtresi), top API, sidebar öne çıkanlar API + yedek; uçtan uca test | `src/lib/views.ts`, `src/pages/api/views/`, `src/components/blog/Sidebar.astro`, `src/pages/blog/[slug].astro`, `src/lib/posts.ts`
|
||||||
|
- 2026-10-16 | Siteyi Kur A4 | Blog: koleksiyon, liste/kategori/etiket arşivleri + sayfalama, detay (paylaş, TOC, DIY, kod kopyala, lisans satırı), sidebar (Pagefind arama), RSS, ana sayfa son yazılar, 3 örnek yazı; axe temiz | `src/content*`, `src/pages/blog/`, `src/pages/rss.xml.ts`, `src/components/blog/`, `src/lib/{posts,dates,markdown-plugins}`, `src/data/{blog,categories}.json`, `astro.config.mjs`, `global.css`
|
||||||
|
- 2026-10-16 | Siteyi Kur A3 | Ana sayfa: hero, 4 kuruluş, Telegram, son yazılar (boş durum), site tanıtımları; axe temiz | `src/data/home.json`, `src/components/home/`, `src/components/Section.astro`, `src/pages/index.astro`, `src/lib/data.ts`
|
||||||
|
- 2026-10-16 | Siteyi Kur A2 | Token'lar, tema anahtarı, SEO bileşeni, layout, header/footer, temel bileşenler, site/social JSON, dev styleguide; axe temiz (2 tema) | `src/styles/`, `src/components/`, `src/layouts/`, `src/data/`, `src/lib/data.ts`, `src/dev/`, `astro.config.mjs`
|
||||||
|
- 2026-10-16 | Siteyi Kur A1 | İskelet: Tailwind 4, mdx, sitemap, node, icon, rss, fontlar, pagefind, prettier, new:post | `astro.config.mjs`, `package.json`, `scripts/`, `src/lib/slug.ts`, `src/styles/`, `README.md`
|
||||||
|
- 2026-10-16 | Siteyi Kur A0 | Ortam kontrolü; hafıza + docs kitten projeye kopyalandı | `CLAUDE.md`, `PROJECT_MEMORY.md`, `docs/`
|
||||||
|
- 2026-10-15 | Kurulum | Skill, CLAUDE.md ve PROJECT_MEMORY.md eklendi | `.claude/`, `CLAUDE.md`, `PROJECT_MEMORY.md`
|
||||||
@@ -1,43 +1,23 @@
|
|||||||
# Astro Starter Kit: Minimal
|
# ta1sph.info
|
||||||
|
|
||||||
```sh
|
Suphi Çakır (TA1SPH) — amatör telsizcilik blog & portfolyo sitesi.
|
||||||
npm create astro@latest -- --template minimal
|
|
||||||
```
|
|
||||||
|
|
||||||
> 🧑🚀 **Seasoned astronaut?** Delete this file. Have fun!
|
- **Stack:** Astro 7 · TailwindCSS 4 · TypeScript (strict)
|
||||||
|
- **Çıktı:** statik site + `@astrojs/node` (yalnızca görüntülenme sayacı API'si dinamik)
|
||||||
|
- **Yayın:** Docker → Dokploy (HomeServer Atlas) → https://ta1sph.info
|
||||||
|
|
||||||
## 🚀 Project Structure
|
## Komutlar
|
||||||
|
|
||||||
Inside of your Astro project, you'll see the following folders and files:
|
| Komut | Açıklama |
|
||||||
|
| :----------------------------- | :--------------------------------------------------- |
|
||||||
|
| `npm install` | Bağımlılıkları kurar |
|
||||||
|
| `npm run dev` | Geliştirme sunucusu (`localhost:4321`) |
|
||||||
|
| `npm run check` | `astro check` (tip ve şablon kontrolü) |
|
||||||
|
| `npm run build` | Üretim derlemesi + Pagefind arama indeksi |
|
||||||
|
| `npm run preview` | Derlenmiş siteyi yerelde çalıştırır |
|
||||||
|
| `npm run format` | Prettier ile biçimlendirir |
|
||||||
|
| `npm run new:post -- "Başlık"` | `src/content/blog/<slug>/index.md` taslağı oluşturur |
|
||||||
|
|
||||||
```text
|
## Lisans
|
||||||
/
|
|
||||||
├── public/
|
|
||||||
├── src/
|
|
||||||
│ └── pages/
|
|
||||||
│ └── index.astro
|
|
||||||
└── package.json
|
|
||||||
```
|
|
||||||
|
|
||||||
Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
|
Kod [MIT](LICENSE), içerik [CC BY-SA 4.0](LICENSE-CONTENT).
|
||||||
|
|
||||||
There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.
|
|
||||||
|
|
||||||
Any static assets, like images, can be placed in the `public/` directory.
|
|
||||||
|
|
||||||
## 🧞 Commands
|
|
||||||
|
|
||||||
All commands are run from the root of the project, from a terminal:
|
|
||||||
|
|
||||||
| Command | Action |
|
|
||||||
| :------------------------ | :----------------------------------------------- |
|
|
||||||
| `npm install` | Installs dependencies |
|
|
||||||
| `npm run dev` | Starts local dev server at `localhost:4321` |
|
|
||||||
| `npm run build` | Build your production site to `./dist/` |
|
|
||||||
| `npm run preview` | Preview your build locally, before deploying |
|
|
||||||
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
|
|
||||||
| `npm run astro -- --help` | Get help using the Astro CLI |
|
|
||||||
|
|
||||||
## 👀 Want to learn more?
|
|
||||||
|
|
||||||
Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
|
|
||||||
|
|||||||
@@ -1,5 +1,48 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
import { defineConfig } from 'astro/config';
|
import { defineConfig } from 'astro/config';
|
||||||
|
|
||||||
|
import tailwindcss from '@tailwindcss/vite';
|
||||||
|
import mdx from '@astrojs/mdx';
|
||||||
|
import sitemap from '@astrojs/sitemap';
|
||||||
|
import node from '@astrojs/node';
|
||||||
|
import icon from 'astro-icon';
|
||||||
|
import { satteri } from '@astrojs/markdown-satteri';
|
||||||
|
import { externalLinksPlugin, figurePlugin } from './src/lib/markdown-plugins.mjs';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dev-only routes (style preview); never part of a production build.
|
||||||
|
* @type {import('astro').AstroIntegration}
|
||||||
|
*/
|
||||||
|
const devRoutes = {
|
||||||
|
name: 'dev-routes',
|
||||||
|
hooks: {
|
||||||
|
'astro:config:setup': ({ command, injectRoute }) => {
|
||||||
|
if (command !== 'dev') return;
|
||||||
|
injectRoute({ pattern: '/styleguide', entrypoint: './src/dev/Styleguide.astro' });
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
// https://astro.build/config
|
// https://astro.build/config
|
||||||
export default defineConfig({});
|
export default defineConfig({
|
||||||
|
site: 'https://ta1sph.info',
|
||||||
|
trailingSlash: 'always',
|
||||||
|
// Static by default; only routes with `export const prerender = false` (view counter API) run on the server.
|
||||||
|
output: 'static',
|
||||||
|
adapter: node({ mode: 'standalone' }),
|
||||||
|
// One small stylesheet: inlining it removes a render-blocking request on every page.
|
||||||
|
build: { inlineStylesheets: 'always' },
|
||||||
|
integrations: [mdx(), sitemap(), icon({ include: { tabler: ['*'] } }), devRoutes],
|
||||||
|
markdown: {
|
||||||
|
processor: satteri({ hastPlugins: [figurePlugin, externalLinksPlugin] }),
|
||||||
|
// Dual themes; colours switch with [data-theme] in global.css.
|
||||||
|
shikiConfig: {
|
||||||
|
themes: { light: 'github-light-high-contrast', dark: 'github-dark-high-contrast' },
|
||||||
|
defaultColor: false,
|
||||||
|
wrap: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
vite: {
|
||||||
|
plugins: [tailwindcss()],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
# İlk Prompt — Claude Code'a yapıştırın
|
||||||
|
|
||||||
|
```text
|
||||||
|
Siteyi Kur
|
||||||
|
|
||||||
|
ta1sph-site skill'ini kullan. Önce PROJECT_MEMORY.md ve skill'in references/ klasöründeki
|
||||||
|
project-spec.md, design-system.md, content-model.md ve build-plan.md dosyalarını oku.
|
||||||
|
Tasarım referansı için docs/design-reference/ içindeki ekran görüntülerine bak
|
||||||
|
(Huemint "Website / Magazine" önizlemesi, palet: #f2efee #d5d09b #111012 #c95748).
|
||||||
|
|
||||||
|
Aşama 0'dan başla: ortamı kontrol et, Astro ve TailwindCSS'in güncel sürümlerini doğrula,
|
||||||
|
bana kısa bir uygulama planı sun ve onayımı bekle. Sonra build-plan.md'deki aşamaları
|
||||||
|
sırayla uygula; her aşama sonunda build al, commit at, PROJECT_MEMORY.md'yi güncelle,
|
||||||
|
bana kısa durum ver ve devam için onay iste.
|
||||||
|
|
||||||
|
Emin olmadığın kişisel veya teknik bilgiyi uydurma, bana sor.
|
||||||
|
```
|
||||||
|
|
||||||
|
## Sonraki oturumlarda örnek komutlar
|
||||||
|
|
||||||
|
```text
|
||||||
|
Makale Ekle
|
||||||
|
Dosya: ~/Belgeler/makaleler/moxon-anten.docx — görseller aynı klasörde. Kategori: antenler.
|
||||||
|
```
|
||||||
|
|
||||||
|
```text
|
||||||
|
Makale Düzenle
|
||||||
|
"moxon-anten-yapimi" makalesine ölçü tablosundan sonra SWR ölçüm sonuçları bölümü ekle: ...
|
||||||
|
```
|
||||||
|
|
||||||
|
```text
|
||||||
|
Uygulama Düzenle
|
||||||
|
Ana sayfadaki Telegram kartlarına üye sayısı yerine kısa açıklama ekle ve kartları 3 sütun yap.
|
||||||
|
```
|
||||||
|
|
||||||
|
```text
|
||||||
|
Yayına Al
|
||||||
|
```
|
||||||
|
|
||||||
|
```text
|
||||||
|
Hafızayı Güncelle
|
||||||
|
```
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
# Kurulum Rehberi — Skill'i VS Code'daki Claude Code'a ekleme
|
||||||
|
|
||||||
|
## Neden proje skill'i?
|
||||||
|
Skill proje klasöründeki `.claude/skills/` altında durur. Böylece:
|
||||||
|
- VS Code'u bu klasörde açtığınız her an Claude Code skill'i otomatik görür,
|
||||||
|
- skill git deposuyla birlikte yedeklenir ve sürümlenir,
|
||||||
|
- `CLAUDE.md` her oturumda otomatik okunur ve `PROJECT_MEMORY.md`'yi (hafıza) içe aktarır.
|
||||||
|
|
||||||
|
## Ön koşullar
|
||||||
|
- Node.js 22 LTS veya üzeri (`node -v`)
|
||||||
|
- Git (`git --version`)
|
||||||
|
- VS Code + **Claude Code** eklentisi (Marketplace'te "Claude Code", yayıncı Anthropic), Claude hesabınızla giriş yapılmış
|
||||||
|
|
||||||
|
## Adımlar
|
||||||
|
|
||||||
|
1. **Zip'i açın** ve içeriğini **proje klasörünüzün köküne** kopyalayın. Sonuç şöyle olmalı:
|
||||||
|
|
||||||
|
```
|
||||||
|
proje-klasoru/
|
||||||
|
├── .claude/
|
||||||
|
│ └── skills/
|
||||||
|
│ └── ta1sph-site/
|
||||||
|
│ ├── SKILL.md
|
||||||
|
│ ├── references/ (7 dosya)
|
||||||
|
│ └── templates/article.md
|
||||||
|
├── docs/
|
||||||
|
│ ├── design-reference/ (5 ekran görüntüsü)
|
||||||
|
│ ├── ILK_PROMPT.md
|
||||||
|
│ └── KURULUM.md
|
||||||
|
├── CLAUDE.md
|
||||||
|
└── PROJECT_MEMORY.md
|
||||||
|
```
|
||||||
|
|
||||||
|
> `.claude` gizli bir klasördür. macOS Finder'da görmek için `Cmd+Shift+.`, Windows'ta Gezgin → Görünüm → Gizli öğeler.
|
||||||
|
|
||||||
|
2. **Git'i başlatın** (önerilir, terminalde proje klasöründe):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git init -b main
|
||||||
|
git add .
|
||||||
|
git commit -m "chore: add Claude Code skill and project memory"
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **VS Code'u bu klasörde açın:** `Dosya → Klasör Aç…` (veya terminalde `code .`).
|
||||||
|
|
||||||
|
4. **Claude Code panelini açın** (kenar çubuğundaki Claude simgesi veya Komut Paleti → "Claude Code: Open"). Klasör ilk açıldığında "bu klasöre güveniyor musunuz" sorulursa onaylayın.
|
||||||
|
|
||||||
|
5. **Skill'in yüklendiğini doğrulayın.** Panelde şunu yazın:
|
||||||
|
|
||||||
|
```text
|
||||||
|
Hangi skill'ler yüklü? ta1sph-site skill'ini görüyor musun, kısaca ne yaptığını söyle.
|
||||||
|
```
|
||||||
|
|
||||||
|
Claude `ta1sph-site`'ı ve komutları (Siteyi Kur, Makale Ekle…) saymalı. Görmüyorsa: dosya yolunun tam olarak `.claude/skills/ta1sph-site/SKILL.md` olduğunu kontrol edin ve paneli yeniden başlatın.
|
||||||
|
|
||||||
|
6. **İlk prompt'u gönderin:** `docs/ILK_PROMPT.md` içindeki kod bloğunu kopyalayıp yapıştırın.
|
||||||
|
|
||||||
|
7. **Aşamaları onaylayarak ilerleyin.** Claude her aşamanın sonunda durup özet verecek. "Devam" yazmanız yeterli. Komut çalıştırma izinleri sorulduğunda (`npm install`, `git commit` vb.) okuyup onaylayın.
|
||||||
|
|
||||||
|
## Kullanım ipuçları
|
||||||
|
- Yeni bir sohbet başlattığınızda Claude hafızayı `CLAUDE.md` → `PROJECT_MEMORY.md` üzerinden okur; projeyi baştan taramaz.
|
||||||
|
- Bir oturum çok uzarsa yeni sohbet açın; hafıza sayesinde kaldığı yerden devam eder.
|
||||||
|
- Hafızanın kodla uyumsuz olduğunu düşünürseniz: `Hafızayı Güncelle`.
|
||||||
|
- Skill'i daha sonra değiştirmek isterseniz `SKILL.md` veya `references/*.md` dosyalarını düzenleyin ya da Claude'a "skill'e şu kuralı ekle" deyin.
|
||||||
|
|
||||||
|
## Deploy (site hazır olduğunda)
|
||||||
|
`Yayına Al` komutunu verin; Claude size `references/deployment.md`'deki Dokploy kontrol listesini (DNS, port yönlendirme, domain, SSL, volume, www→apex) adım adım uygulatacak.
|
||||||
|
After Width: | Height: | Size: 375 KiB |
|
After Width: | Height: | Size: 325 KiB |
|
After Width: | Height: | Size: 78 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 19 KiB |
@@ -7,11 +7,45 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "astro dev",
|
"dev": "astro dev",
|
||||||
"build": "astro build",
|
"build": "astro build && pagefind --site dist/client",
|
||||||
|
"check": "astro check",
|
||||||
"preview": "astro preview",
|
"preview": "astro preview",
|
||||||
"astro": "astro"
|
"format": "prettier --write .",
|
||||||
|
"format:check": "prettier --check .",
|
||||||
|
"new:post": "node scripts/new-post.mjs",
|
||||||
|
"astro": "astro",
|
||||||
|
"icons": "node scripts/generate-icons.mjs",
|
||||||
|
"check:site": "node scripts/check-site.mjs",
|
||||||
|
"fonts": "node scripts/subset-fonts.mjs"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"astro": "^7.4.0"
|
"@astrojs/markdown-satteri": "^0.4.4",
|
||||||
|
"@astrojs/mdx": "^8.1.0",
|
||||||
|
"@astrojs/node": "^11.1.8",
|
||||||
|
"@astrojs/rss": "^4.0.19",
|
||||||
|
"@astrojs/sitemap": "^3.7.4",
|
||||||
|
"@iconify-json/tabler": "^1.2.42",
|
||||||
|
"@tailwindcss/vite": "^4.3.3",
|
||||||
|
"astro": "^7.4.0",
|
||||||
|
"astro-icon": "^1.2.0",
|
||||||
|
"leaflet": "^1.9.4",
|
||||||
|
"tailwindcss": "^4.3.3"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@astrojs/check": "^0.9.10",
|
||||||
|
"@fontsource-variable/inter": "^5.3.0",
|
||||||
|
"@fontsource-variable/rubik": "^5.3.0",
|
||||||
|
"@fontsource/inter": "^5.3.0",
|
||||||
|
"@fontsource/rubik": "^5.3.0",
|
||||||
|
"@tailwindcss/typography": "^0.5.20",
|
||||||
|
"@types/leaflet": "^1.9.22",
|
||||||
|
"pagefind": "^1.5.2",
|
||||||
|
"prettier": "^3.9.10",
|
||||||
|
"prettier-plugin-astro": "^1.1.1",
|
||||||
|
"prettier-plugin-tailwindcss": "^0.8.1",
|
||||||
|
"satori": "^0.60.0",
|
||||||
|
"sharp": "^0.35.5",
|
||||||
|
"subset-font": "^2.9.0",
|
||||||
|
"typescript": "^6.0.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 655 B After Width: | Height: | Size: 2.7 KiB |
@@ -1,9 +1 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 128 128">
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><rect width="32" height="32" rx="6" fill="#c95748"/><g transform="translate(4.48 4.48) scale(0.96)"><g fill="none" stroke="#111012" stroke-linecap="round" stroke-linejoin="round" stroke-width="2.4"><path d="M11 12a1 1 0 1 0 2 0a1 1 0 1 0-2 0"/><path d="M16.616 13.924a5 5 0 1 0-9.23 0"/><path d="M20.307 15.469a9 9 0 1 0-16.615 0"/><path d="m9 21l3-9l3 9m-5-2h4"/></g></g></svg>
|
||||||
<path d="M50.4 78.5a75.1 75.1 0 0 0-28.5 6.9l24.2-65.7c.7-2 1.9-3.2 3.4-3.2h29c1.5 0 2.7 1.2 3.4 3.2l24.2 65.7s-11.6-7-28.5-7L67 45.5c-.4-1.7-1.6-2.8-2.9-2.8-1.3 0-2.5 1.1-2.9 2.7L50.4 78.5Zm-1.1 28.2Zm-4.2-20.2c-2 6.6-.6 15.8 4.2 20.2a17.5 17.5 0 0 1 .2-.7 5.5 5.5 0 0 1 5.7-4.5c2.8.1 4.3 1.5 4.7 4.7.2 1.1.2 2.3.2 3.5v.4c0 2.7.7 5.2 2.2 7.4a13 13 0 0 0 5.7 4.9v-.3l-.2-.3c-1.8-5.6-.5-9.5 4.4-12.8l1.5-1a73 73 0 0 0 3.2-2.2 16 16 0 0 0 6.8-11.4c.3-2 .1-4-.6-6l-.8.6-1.6 1a37 37 0 0 1-22.4 2.7c-5-.7-9.7-2-13.2-6.2Z" />
|
|
||||||
<style>
|
|
||||||
path { fill: #000; }
|
|
||||||
@media (prefers-color-scheme: dark) {
|
|
||||||
path { fill: #FFF; }
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 749 B After Width: | Height: | Size: 438 B |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 15 KiB |
@@ -0,0 +1,75 @@
|
|||||||
|
// Post-build audit of dist/client: one h1, alt text, SEO tags, unique ids, internal links/anchors.
|
||||||
|
// Usage: npm run build && npm run check:site
|
||||||
|
import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
|
||||||
|
import { join, relative } from 'node:path';
|
||||||
|
|
||||||
|
const ROOT = 'dist/client';
|
||||||
|
const SERVER_ROUTES = [/^\/api\//]; // on-demand routes, not files
|
||||||
|
|
||||||
|
const walk = (dir) =>
|
||||||
|
readdirSync(dir).flatMap((f) => {
|
||||||
|
const p = join(dir, f);
|
||||||
|
return statSync(p).isDirectory() ? walk(p) : [p];
|
||||||
|
});
|
||||||
|
|
||||||
|
const pages = walk(ROOT).filter((f) => f.endsWith('.html') && !f.includes('/pagefind/'));
|
||||||
|
const idsByPage = new Map();
|
||||||
|
const problems = [];
|
||||||
|
const report = (page, msg) => problems.push(`${page}: ${msg}`);
|
||||||
|
|
||||||
|
const urlOf = (file) =>
|
||||||
|
'/' +
|
||||||
|
relative(ROOT, file)
|
||||||
|
.replace(/index\.html$/, '')
|
||||||
|
.replace(/\.html$/, '');
|
||||||
|
const html = new Map(pages.map((f) => [urlOf(f), readFileSync(f, 'utf8')]));
|
||||||
|
|
||||||
|
for (const [url, src] of html) {
|
||||||
|
const ids = [...src.matchAll(/\sid="([^"]+)"/g)].map((m) => m[1]);
|
||||||
|
idsByPage.set(url, new Set(ids));
|
||||||
|
const dupes = ids.filter((id, i) => ids.indexOf(id) !== i);
|
||||||
|
if (dupes.length) report(url, `duplicate id(s): ${[...new Set(dupes)].join(', ')}`);
|
||||||
|
|
||||||
|
const h1 = (src.match(/<h1[\s>]/g) ?? []).length;
|
||||||
|
if (h1 !== 1) report(url, `${h1} <h1> elements`);
|
||||||
|
if (!/<html[^>]+lang="/.test(src)) report(url, 'missing <html lang>');
|
||||||
|
if (!/<title>[^<]+<\/title>/.test(src)) report(url, 'missing <title>');
|
||||||
|
if (url !== '/404' && !/<meta name="description" content="[^"]+"/.test(src))
|
||||||
|
report(url, 'missing meta description');
|
||||||
|
if (url !== '/404' && !/<link rel="canonical" href="https:\/\/ta1sph\.info\//.test(src))
|
||||||
|
report(url, 'missing canonical');
|
||||||
|
for (const img of src.match(/<img\b[^>]*>/g) ?? []) {
|
||||||
|
if (!/\salt="/.test(img)) report(url, `img without alt: ${img.slice(0, 80)}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const [url, src] of html) {
|
||||||
|
const refs = [...src.matchAll(/\s(?:href|src)="([^"]+)"/g)].map((m) => m[1]);
|
||||||
|
for (const ref of refs) {
|
||||||
|
if (/^(https?:|mailto:|tel:|data:|javascript:)/.test(ref) || ref.startsWith('//')) {
|
||||||
|
if (!ref.startsWith('https://ta1sph.info')) continue;
|
||||||
|
}
|
||||||
|
const target = new URL(ref.replaceAll('&', '&'), `https://ta1sph.info${url}`);
|
||||||
|
if (target.host !== 'ta1sph.info') continue;
|
||||||
|
const path = decodeURIComponent(target.pathname);
|
||||||
|
if (SERVER_ROUTES.some((r) => r.test(path))) continue;
|
||||||
|
const file = path.endsWith('/')
|
||||||
|
? join(ROOT, path, 'index.html')
|
||||||
|
: ([join(ROOT, path), join(ROOT, `${path}.html`)].find(existsSync) ?? join(ROOT, path));
|
||||||
|
if (!existsSync(file)) {
|
||||||
|
report(url, `broken link → ${path}`);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (target.hash && idsByPage.has(path)) {
|
||||||
|
const id = decodeURIComponent(target.hash.slice(1));
|
||||||
|
if (!idsByPage.get(path).has(id)) report(url, `missing anchor → ${path}${target.hash}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(`Checked ${html.size} pages.`);
|
||||||
|
if (problems.length) {
|
||||||
|
console.error(problems.map((p) => ` ✗ ${p}`).join('\n'));
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
console.log(' ✓ no problems found');
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
// Regenerates the favicon set in public/ from the Tabler antenna-tower icon.
|
||||||
|
// Usage: npm run icons
|
||||||
|
import { writeFileSync } from 'node:fs';
|
||||||
|
import { createRequire } from 'node:module';
|
||||||
|
import sharp from 'sharp';
|
||||||
|
|
||||||
|
const require = createRequire(import.meta.url);
|
||||||
|
const { icons } = require('@iconify-json/tabler/icons.json');
|
||||||
|
|
||||||
|
const RED = '#c95748';
|
||||||
|
const INK = '#111012';
|
||||||
|
const tower = (stroke) =>
|
||||||
|
icons['building-broadcast-tower'].body
|
||||||
|
.replaceAll('currentColor', INK)
|
||||||
|
.replaceAll('stroke-width="2"', `stroke-width="${stroke}"`);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Square icon: red background, ink tower.
|
||||||
|
* `pad` = icon inset (0..1), `radius` in viewBox units, `stroke` = Tabler stroke width.
|
||||||
|
*/
|
||||||
|
const svg = ({ pad = 0.14, radius = 6, stroke = 2.4 } = {}) => {
|
||||||
|
const size = 32;
|
||||||
|
const inner = size * (1 - pad * 2);
|
||||||
|
const offset = size * pad;
|
||||||
|
const scale = inner / 24;
|
||||||
|
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${size} ${size}"><rect width="${size}" height="${size}" rx="${radius}" fill="${RED}"/><g transform="translate(${offset} ${offset}) scale(${scale})">${tower(stroke)}</g></svg>`;
|
||||||
|
};
|
||||||
|
|
||||||
|
const png = (source, px) =>
|
||||||
|
sharp(Buffer.from(source), { density: 72 * (px / 32) * 4 })
|
||||||
|
.resize(px, px)
|
||||||
|
.png()
|
||||||
|
.toBuffer();
|
||||||
|
|
||||||
|
/** ICO container with embedded PNG images. */
|
||||||
|
function ico(images) {
|
||||||
|
const header = Buffer.alloc(6 + images.length * 16);
|
||||||
|
header.writeUInt16LE(0, 0);
|
||||||
|
header.writeUInt16LE(1, 2);
|
||||||
|
header.writeUInt16LE(images.length, 4);
|
||||||
|
let offset = header.length;
|
||||||
|
images.forEach(({ size, data }, i) => {
|
||||||
|
const e = 6 + i * 16;
|
||||||
|
header.writeUInt8(size >= 256 ? 0 : size, e);
|
||||||
|
header.writeUInt8(size >= 256 ? 0 : size, e + 1);
|
||||||
|
header.writeUInt16LE(1, e + 4); // colour planes
|
||||||
|
header.writeUInt16LE(32, e + 6); // bits per pixel
|
||||||
|
header.writeUInt32LE(data.length, e + 8);
|
||||||
|
header.writeUInt32LE(offset, e + 12);
|
||||||
|
offset += data.length;
|
||||||
|
});
|
||||||
|
return Buffer.concat([header, ...images.map((i) => i.data)]);
|
||||||
|
}
|
||||||
|
|
||||||
|
const rounded = svg();
|
||||||
|
const tiny = svg({ pad: 0.06, radius: 4, stroke: 3.2 }); // 16 px tab icon: bigger, bolder
|
||||||
|
const square = svg({ radius: 0 }); // platforms apply their own mask
|
||||||
|
const maskable = svg({ pad: 0.24, radius: 0 }); // keep the icon inside the 80% safe zone
|
||||||
|
|
||||||
|
writeFileSync('public/favicon.svg', rounded);
|
||||||
|
writeFileSync(
|
||||||
|
'public/favicon.ico',
|
||||||
|
ico(
|
||||||
|
await Promise.all(
|
||||||
|
[16, 32, 48].map(async (size) => ({
|
||||||
|
size,
|
||||||
|
data: await png(size === 16 ? tiny : rounded, size),
|
||||||
|
})),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
writeFileSync('public/apple-touch-icon.png', await png(svg({ pad: 0.18, radius: 0 }), 180));
|
||||||
|
writeFileSync('public/icon-192.png', await png(square, 192));
|
||||||
|
writeFileSync('public/icon-512.png', await png(square, 512));
|
||||||
|
writeFileSync('public/icon-maskable-512.png', await png(maskable, 512));
|
||||||
|
console.log('Icons written to public/');
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
// Usage: npm run new:post -- "Yazı Başlığı"
|
||||||
|
import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
|
||||||
|
import { join } from 'node:path';
|
||||||
|
import { slugify } from '../src/lib/slug.ts';
|
||||||
|
|
||||||
|
const title = process.argv.slice(2).join(' ').trim();
|
||||||
|
if (!title) {
|
||||||
|
console.error('Kullanım: npm run new:post -- "Yazı Başlığı"');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
const slug = slugify(title);
|
||||||
|
const dir = join('src', 'content', 'blog', slug);
|
||||||
|
if (existsSync(dir)) {
|
||||||
|
console.error(`Zaten var: ${dir}`);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
const today = new Intl.DateTimeFormat('en-CA', { timeZone: 'Europe/Istanbul' }).format(new Date());
|
||||||
|
const body = `---
|
||||||
|
title: ${JSON.stringify(title)}
|
||||||
|
description: "Arama sonuçlarında görünecek 120–155 karakterlik açıklama."
|
||||||
|
pubDate: ${today}
|
||||||
|
# updatedDate: ${today}
|
||||||
|
category: "genel"
|
||||||
|
tags: []
|
||||||
|
# cover: "./kapak.jpg"
|
||||||
|
# coverAlt: "Kapak görselinin anlamlı açıklaması"
|
||||||
|
featured: false
|
||||||
|
diy: false
|
||||||
|
draft: true
|
||||||
|
---
|
||||||
|
|
||||||
|
Giriş paragrafı: yazının neyi anlattığını ve okuyucunun ne kazanacağını 2–3 cümlede söyle.
|
||||||
|
|
||||||
|
## Birinci Bölüm
|
||||||
|
|
||||||
|
Metin…
|
||||||
|
|
||||||
|
## Sonuç
|
||||||
|
|
||||||
|
Kısa özet ve varsa sonraki adımlar.
|
||||||
|
|
||||||
|
73 de TA1SPH
|
||||||
|
`;
|
||||||
|
|
||||||
|
mkdirSync(dir, { recursive: true });
|
||||||
|
writeFileSync(join(dir, 'index.md'), body);
|
||||||
|
console.log(`Oluşturuldu: ${join(dir, 'index.md')} (draft: true)`);
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
// Builds small self-hosted variable fonts (Latin + Turkish + symbols used in posts) into public/fonts/.
|
||||||
|
// Sources: @fontsource-variable/{rubik,inter} (SIL OFL 1.1). Usage: npm run fonts
|
||||||
|
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
||||||
|
import { createRequire } from 'node:module';
|
||||||
|
import subsetFont from 'subset-font';
|
||||||
|
|
||||||
|
const require = createRequire(import.meta.url);
|
||||||
|
|
||||||
|
const ranges = [
|
||||||
|
[0x20, 0x7e], // Basic Latin
|
||||||
|
[0xa0, 0xff], // Latin-1 (ç ö ü · ° × …)
|
||||||
|
[0x11e, 0x11f], // Ğ ğ
|
||||||
|
[0x130, 0x131], // İ ı
|
||||||
|
[0x15e, 0x15f], // Ş ş
|
||||||
|
[0x394, 0x394], // Δ
|
||||||
|
[0x3a9, 0x3a9], // Ω
|
||||||
|
[0x3bb, 0x3bc], // λ μ
|
||||||
|
[0x2013, 0x2014], // – —
|
||||||
|
[0x2018, 0x201e], // ‘ ’ ‚ “ ” „
|
||||||
|
[0x2022, 0x2022], // •
|
||||||
|
[0x2026, 0x2026], // …
|
||||||
|
[0x2032, 0x2033], // ′ ″
|
||||||
|
[0x20ba, 0x20ba], // ₺
|
||||||
|
[0x2122, 0x2122], // ™
|
||||||
|
[0x2190, 0x2193], // ← ↑ → ↓
|
||||||
|
[0x2212, 0x2212], // −
|
||||||
|
[0x2248, 0x2248], // ≈
|
||||||
|
[0x2264, 0x2265], // ≤ ≥
|
||||||
|
];
|
||||||
|
const text = ranges
|
||||||
|
.flatMap(([a, b]) => Array.from({ length: b - a + 1 }, (_, i) => String.fromCodePoint(a + i)))
|
||||||
|
.join('');
|
||||||
|
|
||||||
|
// Fontsource ships each family split by unicode-range (latin / latin-ext). Each part is subset
|
||||||
|
// on its own and keeps Fontsource's unicode-range, so browsers fetch only the parts a page needs.
|
||||||
|
const families = [
|
||||||
|
{ pkg: '@fontsource-variable/rubik', family: 'Rubik Variable', slug: 'rubik', wght: [400, 900] },
|
||||||
|
{ pkg: '@fontsource-variable/inter', family: 'Inter Variable', slug: 'inter', wght: [400, 700] },
|
||||||
|
];
|
||||||
|
const parts = ['latin', 'latin-ext'];
|
||||||
|
|
||||||
|
/** unicode-range of one Fontsource part, read from the package's own CSS. */
|
||||||
|
function unicodeRange(pkg, slug, part) {
|
||||||
|
const css = readFileSync(require.resolve(`${pkg}/index.css`), 'utf8');
|
||||||
|
const block = css
|
||||||
|
.split('@font-face')
|
||||||
|
.find((b) => b.includes(`${slug}-${part}-wght-normal.woff2`));
|
||||||
|
const m = block?.match(/unicode-range:\s*([^;]+);/);
|
||||||
|
if (!m) throw new Error(`unicode-range not found for ${slug} ${part}`);
|
||||||
|
return m[1].trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
mkdirSync('public/fonts', { recursive: true });
|
||||||
|
const faces = [];
|
||||||
|
for (const f of families) {
|
||||||
|
for (const part of parts) {
|
||||||
|
const source = readFileSync(
|
||||||
|
require.resolve(`${f.pkg}/files/${f.slug}-${part}-wght-normal.woff2`),
|
||||||
|
);
|
||||||
|
const out = await subsetFont(source, text, {
|
||||||
|
targetFormat: 'woff2',
|
||||||
|
variationAxes: { wght: { min: f.wght[0], max: f.wght[1] } },
|
||||||
|
});
|
||||||
|
const file = `${f.slug}-${part}.woff2`;
|
||||||
|
writeFileSync(`public/fonts/${file}`, out);
|
||||||
|
console.log(`${file}: ${source.length} → ${out.length} bytes`);
|
||||||
|
faces.push(`@font-face {
|
||||||
|
font-family: '${f.family}';
|
||||||
|
font-style: normal;
|
||||||
|
font-display: swap;
|
||||||
|
font-weight: ${f.wght[0]} ${f.wght[1]};
|
||||||
|
src: url('/fonts/${file}') format('woff2-variations');
|
||||||
|
unicode-range: ${unicodeRange(f.pkg, f.slug, part)};
|
||||||
|
}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
writeFileSync(
|
||||||
|
'src/styles/fonts.css',
|
||||||
|
`/* Generated by scripts/subset-fonts.mjs — do not edit. Fonts: SIL OFL 1.1 (Rubik, Inter). */\n${faces.join('\n')}\n`,
|
||||||
|
);
|
||||||
|
console.log('Wrote src/styles/fonts.css');
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
---
|
||||||
|
import { Icon } from 'astro-icon/components';
|
||||||
|
|
||||||
|
type Variant = 'solid' | 'outline' | 'category';
|
||||||
|
|
||||||
|
export interface Props {
|
||||||
|
variant?: Variant;
|
||||||
|
icon?: string;
|
||||||
|
href?: string;
|
||||||
|
class?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { variant = 'solid', icon, href, class: className } = Astro.props;
|
||||||
|
|
||||||
|
const variants: Record<Variant, string> = {
|
||||||
|
// accent-fill (not accent) keeps small text ≥ 4.5:1 in both themes.
|
||||||
|
solid: 'bg-accent-fill text-on-accent-fill font-semibold',
|
||||||
|
outline: 'border border-line text-fg-muted',
|
||||||
|
category:
|
||||||
|
'bg-khaki text-ink font-semibold dark:bg-bg-alt dark:text-fg dark:border dark:border-line',
|
||||||
|
};
|
||||||
|
const Tag = href ? 'a' : 'span';
|
||||||
|
---
|
||||||
|
|
||||||
|
<Tag
|
||||||
|
href={href}
|
||||||
|
class:list={[
|
||||||
|
'inline-flex w-fit items-center gap-1 rounded-sm px-2 py-0.5 text-xs leading-5',
|
||||||
|
variants[variant],
|
||||||
|
href && 'hover:underline',
|
||||||
|
className,
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
{icon && <Icon name={icon} class="size-3.5" aria-hidden="true" />}
|
||||||
|
<slot />
|
||||||
|
</Tag>
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
---
|
||||||
|
import type { HTMLAttributes } from 'astro/types';
|
||||||
|
import { Icon } from 'astro-icon/components';
|
||||||
|
import { site } from '../lib/data';
|
||||||
|
|
||||||
|
type Variant = 'primary' | 'secondary' | 'link';
|
||||||
|
|
||||||
|
export interface Props extends HTMLAttributes<'a'> {
|
||||||
|
href?: string;
|
||||||
|
variant?: Variant;
|
||||||
|
icon?: string;
|
||||||
|
type?: 'button' | 'submit';
|
||||||
|
/** Opens in a new tab with rel=noopener and a screen-reader hint. */
|
||||||
|
external?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
const {
|
||||||
|
href,
|
||||||
|
variant = 'primary',
|
||||||
|
icon,
|
||||||
|
type = 'button',
|
||||||
|
external = false,
|
||||||
|
class: className,
|
||||||
|
...rest
|
||||||
|
} = Astro.props;
|
||||||
|
const externalAttrs = external ? { target: '_blank', rel: 'noopener noreferrer' } : {};
|
||||||
|
|
||||||
|
// Primary uses ink on red at ≥19px bold (large text, ratio 4.46 ≥ 3).
|
||||||
|
const variants: Record<Variant, string> = {
|
||||||
|
primary:
|
||||||
|
'bg-accent text-on-accent px-6 py-3 text-[1.1875rem] font-bold rounded-[2px] hover:bg-fg hover:text-bg',
|
||||||
|
secondary:
|
||||||
|
'bg-fg text-bg px-6 py-3 text-[1.1875rem] font-bold rounded-[2px] hover:bg-accent hover:text-on-accent',
|
||||||
|
link: 'link-strong text-lg',
|
||||||
|
};
|
||||||
|
const classes = [
|
||||||
|
'font-display inline-flex items-center gap-2 transition-colors',
|
||||||
|
variants[variant],
|
||||||
|
className,
|
||||||
|
];
|
||||||
|
---
|
||||||
|
|
||||||
|
{href ? (
|
||||||
|
<a href={href} class:list={classes} {...externalAttrs} {...rest}>
|
||||||
|
<slot />
|
||||||
|
{icon && <Icon name={icon} class="size-5" aria-hidden="true" />}
|
||||||
|
{external && <span class="sr-only">{site.ui.newTab}</span>}
|
||||||
|
</a>
|
||||||
|
) : (
|
||||||
|
<button type={type} class:list={[classes, 'cursor-pointer']}>
|
||||||
|
<slot />
|
||||||
|
{icon && <Icon name={icon} class="size-5" aria-hidden="true" />}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
import type { HTMLAttributes, HTMLTag } from 'astro/types';
|
||||||
|
|
||||||
|
export interface Props extends Omit<HTMLAttributes<'div'>, 'class'> {
|
||||||
|
as?: HTMLTag;
|
||||||
|
/** Adds hover lift; the card's own link should cover it via `after:absolute after:inset-0`. */
|
||||||
|
interactive?: boolean;
|
||||||
|
class?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { as: Tag = 'article', interactive = false, class: className, ...rest } = Astro.props;
|
||||||
|
---
|
||||||
|
|
||||||
|
<Tag
|
||||||
|
{...rest}
|
||||||
|
class:list={[
|
||||||
|
'bg-surface border-line relative flex flex-col border',
|
||||||
|
interactive &&
|
||||||
|
'transition-[transform,box-shadow] duration-200 hover:-translate-y-0.5 hover:shadow-[4px_4px_0_var(--line)] focus-within:-translate-y-0.5',
|
||||||
|
className,
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<slot />
|
||||||
|
</Tag>
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
---
|
||||||
|
// Wraps rendered Markdown and adds a copy button to every code block.
|
||||||
|
import { blog } from '../lib/data';
|
||||||
|
---
|
||||||
|
|
||||||
|
<div data-code-copy={blog.post.copyCode} data-code-copied={blog.post.codeCopied}>
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
for (const root of document.querySelectorAll<HTMLElement>('[data-code-copy]')) {
|
||||||
|
const { codeCopy = '', codeCopied = '' } = root.dataset;
|
||||||
|
for (const pre of root.querySelectorAll('pre')) {
|
||||||
|
const wrap = document.createElement('div');
|
||||||
|
wrap.className = 'code-block';
|
||||||
|
pre.replaceWith(wrap);
|
||||||
|
wrap.append(pre);
|
||||||
|
const btn = document.createElement('button');
|
||||||
|
btn.type = 'button';
|
||||||
|
btn.className = 'code-copy';
|
||||||
|
btn.textContent = codeCopy;
|
||||||
|
btn.addEventListener('click', async () => {
|
||||||
|
try {
|
||||||
|
await navigator.clipboard.writeText(
|
||||||
|
pre.querySelector('code')?.innerText ?? pre.innerText,
|
||||||
|
);
|
||||||
|
btn.textContent = codeCopied;
|
||||||
|
setTimeout(() => (btn.textContent = codeCopy), 2000);
|
||||||
|
} catch {}
|
||||||
|
});
|
||||||
|
wrap.append(btn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
import type { HTMLTag } from 'astro/types';
|
||||||
|
|
||||||
|
export interface Props {
|
||||||
|
as?: HTMLTag;
|
||||||
|
class?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { as: Tag = 'div', class: className } = Astro.props;
|
||||||
|
---
|
||||||
|
|
||||||
|
<Tag class:list={['mx-auto w-full max-w-7xl px-4 sm:px-6 lg:px-8', className]}>
|
||||||
|
<slot />
|
||||||
|
</Tag>
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
import type { HTMLAttributes } from 'astro/types';
|
||||||
|
import { Icon } from 'astro-icon/components';
|
||||||
|
import { site } from '../lib/data';
|
||||||
|
|
||||||
|
export interface Props extends Omit<HTMLAttributes<'a'>, 'target' | 'rel'> {
|
||||||
|
href: string;
|
||||||
|
/** Show the trailing external-link icon. */
|
||||||
|
icon?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { href, icon = true, class: className, ...rest } = Astro.props;
|
||||||
|
---
|
||||||
|
|
||||||
|
<a
|
||||||
|
href={href}
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
class:list={['inline-flex items-center gap-1', className]}
|
||||||
|
{...rest}
|
||||||
|
>
|
||||||
|
<slot />
|
||||||
|
{icon && <Icon name="tabler:external-link" class="size-[1em] shrink-0" aria-hidden="true" />}
|
||||||
|
<span class="sr-only">{site.ui.newTab}</span>
|
||||||
|
</a>
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
---
|
||||||
|
import { Icon } from 'astro-icon/components';
|
||||||
|
import { site, social } from '../lib/data';
|
||||||
|
import Badge from './Badge.astro';
|
||||||
|
import Container from './Container.astro';
|
||||||
|
import ExternalLink from './ExternalLink.astro';
|
||||||
|
|
||||||
|
const year = new Date().getFullYear();
|
||||||
|
const linkClass =
|
||||||
|
'decoration-accent underline-offset-4 hover:underline decoration-2 inline-flex items-center gap-2';
|
||||||
|
const titleClass = 'font-display mb-4 text-sm font-bold tracking-wide uppercase';
|
||||||
|
---
|
||||||
|
|
||||||
|
<footer class="surface-alt border-line border-t">
|
||||||
|
<Container class="grid gap-10 py-14 sm:grid-cols-2 lg:grid-cols-[1.5fr_1fr_1fr_1fr]">
|
||||||
|
<section aria-labelledby="footer-about">
|
||||||
|
<h2 id="footer-about" class="font-display text-3xl font-black tracking-tight uppercase">
|
||||||
|
{site.name}
|
||||||
|
</h2>
|
||||||
|
<p class="mt-3 max-w-sm">{site.footer.about}</p>
|
||||||
|
<Badge variant="solid" icon="tabler:antenna" class="mt-4">
|
||||||
|
{site.author.callsign} · {site.author.locator}
|
||||||
|
</Badge>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<nav aria-labelledby="footer-links">
|
||||||
|
<h2 id="footer-links" class={titleClass}>
|
||||||
|
{site.footer.quickLinksTitle}
|
||||||
|
</h2>
|
||||||
|
<ul class="flex flex-col gap-2">
|
||||||
|
{site.nav.map((item) => (
|
||||||
|
<li>
|
||||||
|
<a href={item.href} class={linkClass}>
|
||||||
|
{item.label}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
<li>
|
||||||
|
<a href={site.footer.rss.href} class={linkClass}>
|
||||||
|
<Icon name="tabler:rss" class="size-4" aria-hidden="true" />
|
||||||
|
{site.footer.rss.label}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<nav aria-labelledby="footer-legal">
|
||||||
|
<h2 id="footer-legal" class={titleClass}>
|
||||||
|
{site.footer.legalTitle}
|
||||||
|
</h2>
|
||||||
|
<ul class="flex flex-col gap-2">
|
||||||
|
{site.footer.legal.map((item) => (
|
||||||
|
<li>
|
||||||
|
<a href={item.href} class={linkClass}>
|
||||||
|
{item.label}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
{social.length > 0 && (
|
||||||
|
<section aria-labelledby="footer-social">
|
||||||
|
<h2 id="footer-social" class={titleClass}>
|
||||||
|
{site.footer.socialTitle}
|
||||||
|
</h2>
|
||||||
|
<ul class="flex flex-wrap gap-2">
|
||||||
|
{social.map((s) => (
|
||||||
|
<li>
|
||||||
|
<ExternalLink
|
||||||
|
href={s.href}
|
||||||
|
icon={false}
|
||||||
|
title={s.label}
|
||||||
|
class="border-fg hover:bg-fg hover:text-bg size-11 justify-center border transition-colors"
|
||||||
|
>
|
||||||
|
<Icon name={s.icon} class="size-5" aria-hidden="true" />
|
||||||
|
<span class="sr-only">{s.label}</span>
|
||||||
|
</ExternalLink>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
)}
|
||||||
|
</Container>
|
||||||
|
|
||||||
|
<div class="border-line border-t">
|
||||||
|
<Container class="flex flex-col gap-2 py-5 text-sm sm:flex-row sm:items-center sm:justify-between">
|
||||||
|
<p>
|
||||||
|
© {year} {site.author.name} · {site.footer.license}
|
||||||
|
</p>
|
||||||
|
<p class="font-display font-bold tracking-wide uppercase">{site.footer.signoff}</p>
|
||||||
|
</Container>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
// Decorative vertical magazine grid lines (reference: Huemint "Magazine"). Hidden on mobile.
|
||||||
|
export interface Props {
|
||||||
|
class?: string;
|
||||||
|
}
|
||||||
|
const { class: className } = Astro.props;
|
||||||
|
---
|
||||||
|
|
||||||
|
<div
|
||||||
|
aria-hidden="true"
|
||||||
|
class:list={['pointer-events-none absolute inset-0 hidden md:block', className]}
|
||||||
|
>
|
||||||
|
<div class="divide-line border-line mx-auto grid h-full max-w-7xl grid-cols-[1.4fr_1.6fr_2.2fr_2fr] divide-x border-x px-4 sm:px-6 lg:px-8">
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
---
|
||||||
|
import { Icon } from 'astro-icon/components';
|
||||||
|
import { site } from '../lib/data';
|
||||||
|
import Container from './Container.astro';
|
||||||
|
import ThemeToggle from './ThemeToggle.astro';
|
||||||
|
|
||||||
|
const path = Astro.url.pathname;
|
||||||
|
const isActive = (href: string) => (href === '/' ? path === '/' : path.startsWith(href));
|
||||||
|
---
|
||||||
|
|
||||||
|
<header class="border-line relative z-20 border-b">
|
||||||
|
<Container class="flex h-16 items-center justify-between gap-6 md:h-20">
|
||||||
|
<a
|
||||||
|
href="/"
|
||||||
|
class="font-display text-2xl font-black tracking-tight uppercase"
|
||||||
|
aria-label={`${site.name} — ${site.ui.home}`}
|
||||||
|
>
|
||||||
|
{site.name}
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<div class="flex items-center gap-2 md:gap-6">
|
||||||
|
<nav aria-label={site.ui.mainNav} class="hidden md:block">
|
||||||
|
<ul class="flex items-center gap-6">
|
||||||
|
{site.nav.map((item) => (
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
href={item.href}
|
||||||
|
aria-current={isActive(item.href) ? 'page' : undefined}
|
||||||
|
class="font-display hover:border-accent aria-[current=page]:border-accent block border-b-3 border-transparent py-1 text-sm font-bold tracking-wide uppercase transition-colors"
|
||||||
|
>
|
||||||
|
{item.label}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<ThemeToggle />
|
||||||
|
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
popovertarget="mobile-nav"
|
||||||
|
aria-label={site.ui.menuOpen}
|
||||||
|
class="text-fg hover:text-accent inline-flex size-10 cursor-pointer items-center justify-center md:hidden"
|
||||||
|
>
|
||||||
|
<Icon name="tabler:menu-2" class="size-7" aria-hidden="true" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</Container>
|
||||||
|
|
||||||
|
<!-- Native popover: Escape / light-dismiss / focus handling without custom JS. -->
|
||||||
|
<nav
|
||||||
|
id="mobile-nav"
|
||||||
|
popover
|
||||||
|
aria-label={site.ui.mainNav}
|
||||||
|
class="bg-bg-alt text-fg fixed inset-0 m-0 h-dvh max-h-none w-full max-w-none p-0 md:hidden"
|
||||||
|
>
|
||||||
|
<Container class="flex h-16 items-center justify-between">
|
||||||
|
<span class="font-display text-2xl font-black tracking-tight uppercase" aria-hidden="true">
|
||||||
|
{site.name}
|
||||||
|
</span>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
popovertarget="mobile-nav"
|
||||||
|
popovertargetaction="hide"
|
||||||
|
aria-label={site.ui.menuClose}
|
||||||
|
class="hover:text-accent inline-flex size-10 cursor-pointer items-center justify-center"
|
||||||
|
>
|
||||||
|
<Icon name="tabler:x" class="size-7" aria-hidden="true" />
|
||||||
|
</button>
|
||||||
|
</Container>
|
||||||
|
<Container>
|
||||||
|
<ul class="mt-8 flex flex-col gap-2">
|
||||||
|
{site.nav.map((item) => (
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
href={item.href}
|
||||||
|
aria-current={isActive(item.href) ? 'page' : undefined}
|
||||||
|
class="headline aria-[current=page]:decoration-accent block py-2 text-4xl decoration-4 underline-offset-8 aria-[current=page]:underline"
|
||||||
|
>
|
||||||
|
{item.label}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
</Container>
|
||||||
|
</nav>
|
||||||
|
</header>
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
// Khaki page header with grid lines and the page's single h1.
|
||||||
|
import { Icon } from 'astro-icon/components';
|
||||||
|
import Container from './Container.astro';
|
||||||
|
import GridLines from './GridLines.astro';
|
||||||
|
import SectionHeading from './SectionHeading.astro';
|
||||||
|
|
||||||
|
export interface Props {
|
||||||
|
eyebrow: string;
|
||||||
|
title: string;
|
||||||
|
lead?: string;
|
||||||
|
icon?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { eyebrow, title, lead, icon } = Astro.props;
|
||||||
|
---
|
||||||
|
|
||||||
|
<section class="surface-alt relative overflow-hidden">
|
||||||
|
<GridLines />
|
||||||
|
<Container class="relative flex items-end gap-6 py-14 md:py-20">
|
||||||
|
{icon && (
|
||||||
|
<Icon name={icon} class="hidden size-20 shrink-0 sm:block md:size-24" aria-hidden="true" />
|
||||||
|
)}
|
||||||
|
<div class="flex flex-col gap-4">
|
||||||
|
<SectionHeading level={1} eyebrow={eyebrow} title={title} />
|
||||||
|
{lead && <p class="max-w-2xl text-lg">{lead}</p>}
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
|
</Container>
|
||||||
|
</section>
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
// Full-bleed page section: paper or khaki background with the magazine grid lines behind content.
|
||||||
|
import Container from './Container.astro';
|
||||||
|
import GridLines from './GridLines.astro';
|
||||||
|
|
||||||
|
export interface Props {
|
||||||
|
id?: string;
|
||||||
|
alt?: boolean;
|
||||||
|
labelledby?: string;
|
||||||
|
class?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { id, alt = false, labelledby, class: className } = Astro.props;
|
||||||
|
---
|
||||||
|
|
||||||
|
<section
|
||||||
|
id={id}
|
||||||
|
aria-labelledby={labelledby}
|
||||||
|
class:list={['relative overflow-hidden', alt && 'surface-alt']}
|
||||||
|
>
|
||||||
|
<GridLines />
|
||||||
|
<Container class:list={['relative py-16 md:py-24', className]}>
|
||||||
|
<slot />
|
||||||
|
</Container>
|
||||||
|
</section>
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
// Magazine section heading: small red eyebrow with a rule, then a heavy uppercase title.
|
||||||
|
export interface Props {
|
||||||
|
eyebrow?: string;
|
||||||
|
title: string;
|
||||||
|
level?: 1 | 2 | 3;
|
||||||
|
id?: string;
|
||||||
|
class?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { eyebrow, title, level = 2, id, class: className } = Astro.props;
|
||||||
|
const Heading = `h${level}` as 'h1' | 'h2' | 'h3';
|
||||||
|
const sizes = {
|
||||||
|
1: 'text-[clamp(2.75rem,7vw,6rem)]',
|
||||||
|
2: 'text-[clamp(2rem,4.5vw,3.5rem)]',
|
||||||
|
3: 'text-2xl sm:text-3xl',
|
||||||
|
};
|
||||||
|
---
|
||||||
|
|
||||||
|
<header class:list={['flex flex-col gap-3', className]}>
|
||||||
|
{eyebrow && (
|
||||||
|
<p class="font-display text-accent-text flex items-center gap-3 text-sm font-bold tracking-wide uppercase">
|
||||||
|
<span>{eyebrow}</span>
|
||||||
|
<span aria-hidden="true" class="bg-accent h-0.5 w-12" />
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
<Heading id={id} class:list={['headline', sizes[level]]}>
|
||||||
|
{title}
|
||||||
|
</Heading>
|
||||||
|
</header>
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
---
|
||||||
|
import { site, social } from '../lib/data';
|
||||||
|
|
||||||
|
export interface Props {
|
||||||
|
/** Page title without the site suffix. Omit on the home page. */
|
||||||
|
title?: string;
|
||||||
|
description?: string;
|
||||||
|
/** Absolute or root-relative image URL for OG/Twitter. Defaults to the generated /og-default.png. */
|
||||||
|
image?: string;
|
||||||
|
imageAlt?: string;
|
||||||
|
/** Pixel size of `image`, when known. */
|
||||||
|
imageWidth?: number;
|
||||||
|
imageHeight?: number;
|
||||||
|
type?: 'website' | 'article';
|
||||||
|
publishedTime?: Date;
|
||||||
|
modifiedTime?: Date;
|
||||||
|
noindex?: boolean;
|
||||||
|
/** Extra JSON-LD nodes (BlogPosting, BreadcrumbList, …). */
|
||||||
|
jsonLd?: Record<string, unknown>[];
|
||||||
|
}
|
||||||
|
|
||||||
|
const {
|
||||||
|
title,
|
||||||
|
description = site.description,
|
||||||
|
image,
|
||||||
|
imageAlt,
|
||||||
|
imageWidth,
|
||||||
|
imageHeight,
|
||||||
|
type = 'website',
|
||||||
|
publishedTime,
|
||||||
|
modifiedTime,
|
||||||
|
noindex = false,
|
||||||
|
jsonLd = [],
|
||||||
|
} = Astro.props;
|
||||||
|
|
||||||
|
const fullTitle = title ? `${title}${site.titleSeparator}${site.name}` : site.title;
|
||||||
|
const canonical = new URL(Astro.url.pathname, Astro.site ?? site.url).href;
|
||||||
|
// Pages without their own image share the default card (1200×630).
|
||||||
|
const ogImage = image ?? '/og-default.png';
|
||||||
|
const imageUrl = new URL(ogImage, Astro.site ?? site.url).href;
|
||||||
|
const [ogWidth, ogHeight] = image ? [imageWidth, imageHeight] : [1200, 630];
|
||||||
|
const ogAlt = imageAlt ?? (image ? undefined : site.title);
|
||||||
|
const twitterHandle = social.find((s) => s.id === 'x')?.handle;
|
||||||
|
|
||||||
|
const personId = `${site.url}/#person`;
|
||||||
|
const graph = {
|
||||||
|
'@context': 'https://schema.org',
|
||||||
|
'@graph': [
|
||||||
|
{
|
||||||
|
'@type': 'WebSite',
|
||||||
|
'@id': `${site.url}/#website`,
|
||||||
|
url: `${site.url}/`,
|
||||||
|
name: site.title,
|
||||||
|
description: site.description,
|
||||||
|
inLanguage: site.lang,
|
||||||
|
publisher: { '@id': personId },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'@type': 'Person',
|
||||||
|
'@id': personId,
|
||||||
|
name: site.author.name,
|
||||||
|
alternateName: site.author.callsign,
|
||||||
|
url: `${site.url}/`,
|
||||||
|
sameAs: social.map((s) => s.href),
|
||||||
|
},
|
||||||
|
...jsonLd,
|
||||||
|
],
|
||||||
|
};
|
||||||
|
---
|
||||||
|
|
||||||
|
<title>{fullTitle}</title>
|
||||||
|
<meta name="description" content={description} />
|
||||||
|
{noindex ? (
|
||||||
|
<meta name="robots" content="noindex, nofollow" />
|
||||||
|
) : (
|
||||||
|
<link rel="canonical" href={canonical} />
|
||||||
|
)}
|
||||||
|
|
||||||
|
<meta property="og:type" content={type} />
|
||||||
|
<meta property="og:site_name" content={site.title} />
|
||||||
|
<meta property="og:locale" content={site.locale} />
|
||||||
|
<meta property="og:title" content={fullTitle} />
|
||||||
|
<meta property="og:description" content={description} />
|
||||||
|
<meta property="og:url" content={canonical} />
|
||||||
|
<meta property="og:image" content={imageUrl} />
|
||||||
|
{ogWidth && <meta property="og:image:width" content={String(ogWidth)} />}
|
||||||
|
{ogHeight && <meta property="og:image:height" content={String(ogHeight)} />}
|
||||||
|
{ogAlt && <meta property="og:image:alt" content={ogAlt} />}
|
||||||
|
{publishedTime && <meta property="article:published_time" content={publishedTime.toISOString()} />}
|
||||||
|
{modifiedTime && <meta property="article:modified_time" content={modifiedTime.toISOString()} />}
|
||||||
|
|
||||||
|
<meta name="twitter:card" content="summary_large_image" />
|
||||||
|
{twitterHandle && <meta name="twitter:site" content={twitterHandle} />}
|
||||||
|
{twitterHandle && <meta name="twitter:creator" content={twitterHandle} />}
|
||||||
|
<meta name="twitter:title" content={fullTitle} />
|
||||||
|
<meta name="twitter:description" content={description} />
|
||||||
|
<meta name="twitter:image" content={imageUrl} />
|
||||||
|
{ogAlt && <meta name="twitter:image:alt" content={ogAlt} />}
|
||||||
|
|
||||||
|
<script type="application/ld+json" set:html={JSON.stringify(graph)} />
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
---
|
||||||
|
// Runs before first paint to avoid a flash of the wrong theme.
|
||||||
|
---
|
||||||
|
|
||||||
|
<script is:inline>
|
||||||
|
(() => {
|
||||||
|
const root = document.documentElement;
|
||||||
|
const media = matchMedia('(prefers-color-scheme: dark)');
|
||||||
|
let stored = null;
|
||||||
|
try {
|
||||||
|
stored = localStorage.getItem('theme');
|
||||||
|
} catch {}
|
||||||
|
const apply = (t) => {
|
||||||
|
root.dataset.theme = t;
|
||||||
|
};
|
||||||
|
apply(stored === 'light' || stored === 'dark' ? stored : media.matches ? 'dark' : 'light');
|
||||||
|
// Follow the OS while the user has not chosen explicitly.
|
||||||
|
media.addEventListener('change', (e) => {
|
||||||
|
let s = null;
|
||||||
|
try {
|
||||||
|
s = localStorage.getItem('theme');
|
||||||
|
} catch {}
|
||||||
|
if (!s) apply(e.matches ? 'dark' : 'light');
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
---
|
||||||
|
import { Icon } from 'astro-icon/components';
|
||||||
|
import { site } from '../lib/data';
|
||||||
|
---
|
||||||
|
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
data-theme-toggle
|
||||||
|
aria-label={site.ui.themeToggle}
|
||||||
|
aria-pressed="false"
|
||||||
|
class="text-fg hover:text-accent inline-flex size-10 cursor-pointer items-center justify-center rounded-sm transition-colors"
|
||||||
|
>
|
||||||
|
<Icon name="tabler:moon" class="size-6 dark:hidden" aria-hidden="true" />
|
||||||
|
<Icon name="tabler:sun" class="hidden size-6 dark:block" aria-hidden="true" />
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const root = document.documentElement;
|
||||||
|
const sync = () => {
|
||||||
|
const dark = root.dataset.theme === 'dark';
|
||||||
|
document.querySelectorAll<HTMLButtonElement>('[data-theme-toggle]').forEach((btn) => {
|
||||||
|
btn.setAttribute('aria-pressed', String(dark));
|
||||||
|
});
|
||||||
|
};
|
||||||
|
document.querySelectorAll<HTMLButtonElement>('[data-theme-toggle]').forEach((btn) => {
|
||||||
|
btn.addEventListener('click', () => {
|
||||||
|
const next = root.dataset.theme === 'dark' ? 'light' : 'dark';
|
||||||
|
root.dataset.theme = next;
|
||||||
|
try {
|
||||||
|
localStorage.setItem('theme', next);
|
||||||
|
} catch {}
|
||||||
|
sync();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
new MutationObserver(sync).observe(root, { attributes: true, attributeFilter: ['data-theme'] });
|
||||||
|
sync();
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
---
|
||||||
|
// Shared layout for /blog/, category and tag archives (all paginated).
|
||||||
|
import BaseLayout from '../../layouts/BaseLayout.astro';
|
||||||
|
import { blog, fmt } from '../../lib/data';
|
||||||
|
import type { Post } from '../../lib/posts';
|
||||||
|
import Container from '../Container.astro';
|
||||||
|
import PageHeader from '../PageHeader.astro';
|
||||||
|
import Pager from './Pager.astro';
|
||||||
|
import PostCard from './PostCard.astro';
|
||||||
|
import Sidebar from './Sidebar.astro';
|
||||||
|
|
||||||
|
export interface Props {
|
||||||
|
eyebrow: string;
|
||||||
|
title: string;
|
||||||
|
description: string;
|
||||||
|
/** Posts on this page. */
|
||||||
|
posts: Post[];
|
||||||
|
/** All published posts, for the sidebar. */
|
||||||
|
allPosts: Post[];
|
||||||
|
current: number;
|
||||||
|
total: number;
|
||||||
|
base: string;
|
||||||
|
activeCategory?: string;
|
||||||
|
activeTag?: string;
|
||||||
|
jsonLd?: Record<string, unknown>[];
|
||||||
|
}
|
||||||
|
|
||||||
|
const {
|
||||||
|
eyebrow,
|
||||||
|
title,
|
||||||
|
description,
|
||||||
|
posts,
|
||||||
|
allPosts,
|
||||||
|
current,
|
||||||
|
total,
|
||||||
|
base,
|
||||||
|
activeCategory,
|
||||||
|
activeTag,
|
||||||
|
jsonLd,
|
||||||
|
} = Astro.props;
|
||||||
|
const seoTitle = current > 1 ? fmt(blog.list.pageTitle, { title, n: current }) : title;
|
||||||
|
---
|
||||||
|
|
||||||
|
<BaseLayout title={seoTitle} description={description} jsonLd={jsonLd}>
|
||||||
|
<PageHeader eyebrow={eyebrow} title={title} lead={description} />
|
||||||
|
|
||||||
|
<Container class="grid gap-12 py-14 lg:grid-cols-[minmax(0,1fr)_20rem]">
|
||||||
|
<div>
|
||||||
|
{posts.length ? (
|
||||||
|
<ul class="flex flex-col gap-8">
|
||||||
|
{posts.map((post, i) => (
|
||||||
|
<li>
|
||||||
|
<PostCard post={post} priority={i === 0} />
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
) : (
|
||||||
|
<p class="border-fg/30 border-2 border-dashed p-8 text-center text-lg">{blog.list.empty}</p>
|
||||||
|
)}
|
||||||
|
<Pager current={current} total={total} base={base} />
|
||||||
|
</div>
|
||||||
|
<Sidebar posts={allPosts} activeCategory={activeCategory} activeTag={activeTag} />
|
||||||
|
</Container>
|
||||||
|
</BaseLayout>
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
---
|
||||||
|
import { Icon } from 'astro-icon/components';
|
||||||
|
import { blog } from '../../lib/data';
|
||||||
|
|
||||||
|
export interface Props {
|
||||||
|
/** Last item is the current page (no href needed). */
|
||||||
|
items: { label: string; href?: string }[];
|
||||||
|
}
|
||||||
|
|
||||||
|
const { items } = Astro.props;
|
||||||
|
---
|
||||||
|
|
||||||
|
<nav aria-label={blog.post.breadcrumbLabel} class="text-sm">
|
||||||
|
<ol class="flex flex-wrap items-center gap-1">
|
||||||
|
{items.map((item, i) => (
|
||||||
|
<li class="flex items-center gap-1">
|
||||||
|
{i > 0 && (
|
||||||
|
<Icon name="tabler:chevron-right" class="text-fg-muted size-4" aria-hidden="true" />
|
||||||
|
)}
|
||||||
|
{i === items.length - 1 ? (
|
||||||
|
<span aria-current="page" class="text-fg-muted line-clamp-1">
|
||||||
|
{item.label}
|
||||||
|
</span>
|
||||||
|
) : (
|
||||||
|
<a
|
||||||
|
href={item.href}
|
||||||
|
class="decoration-accent font-semibold underline-offset-4 hover:underline"
|
||||||
|
>
|
||||||
|
{item.label}
|
||||||
|
</a>
|
||||||
|
)}
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ol>
|
||||||
|
</nav>
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
---
|
||||||
|
import { blog, fmt } from '../../lib/data';
|
||||||
|
import { dateBadges, formatDate, isoDay, type DateBadge } from '../../lib/dates';
|
||||||
|
import Badge from '../Badge.astro';
|
||||||
|
|
||||||
|
export interface Props {
|
||||||
|
pubDate: Date;
|
||||||
|
updatedDate?: Date;
|
||||||
|
/** Reading time in minutes, shown after the dates. */
|
||||||
|
minutes?: number;
|
||||||
|
class?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { pubDate, updatedDate, minutes, class: className } = Astro.props;
|
||||||
|
const { primary, secondary } = dateBadges(pubDate, updatedDate);
|
||||||
|
|
||||||
|
const meta = (b: DateBadge) =>
|
||||||
|
b.kind === 'updated'
|
||||||
|
? { label: blog.dates.updated, icon: 'tabler:refresh' }
|
||||||
|
: { label: blog.dates.created, icon: 'tabler:calendar-plus' };
|
||||||
|
const p = meta(primary);
|
||||||
|
const s = secondary && meta(secondary);
|
||||||
|
---
|
||||||
|
|
||||||
|
<div class:list={['flex flex-wrap items-center gap-2', className]}>
|
||||||
|
<Badge variant="solid" icon={p.icon}>
|
||||||
|
{p.label}
|
||||||
|
<time datetime={isoDay(primary.date)}>{formatDate(primary.date)}</time>
|
||||||
|
</Badge>
|
||||||
|
{secondary && s && (
|
||||||
|
<Badge variant="outline" icon={s.icon}>
|
||||||
|
{s.label}
|
||||||
|
<time datetime={isoDay(secondary.date)}>{formatDate(secondary.date)}</time>
|
||||||
|
</Badge>
|
||||||
|
)}
|
||||||
|
{minutes && (
|
||||||
|
<Badge variant="outline" icon="tabler:clock">
|
||||||
|
{fmt(blog.card.readingTime, { n: minutes })}
|
||||||
|
</Badge>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
import { Icon } from 'astro-icon/components';
|
||||||
|
import { blog } from '../../lib/data';
|
||||||
|
---
|
||||||
|
|
||||||
|
<aside
|
||||||
|
role="note"
|
||||||
|
aria-labelledby="diy-title"
|
||||||
|
class="border-accent bg-surface flex gap-4 border-l-4 p-5"
|
||||||
|
>
|
||||||
|
<Icon name="tabler:alert-triangle" class="text-accent-text size-7 shrink-0" aria-hidden="true" />
|
||||||
|
<div class="flex flex-col gap-2">
|
||||||
|
<p id="diy-title" class="font-display font-bold tracking-wide uppercase">
|
||||||
|
{blog.diy.title}
|
||||||
|
</p>
|
||||||
|
<p class="text-sm">{blog.diy.body}</p>
|
||||||
|
<a
|
||||||
|
href={blog.diy.link.href}
|
||||||
|
class="decoration-accent text-sm font-semibold underline underline-offset-4"
|
||||||
|
>
|
||||||
|
{blog.diy.link.label}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</aside>
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
---
|
||||||
|
import { Icon } from 'astro-icon/components';
|
||||||
|
import { blog, fmt } from '../../lib/data';
|
||||||
|
import { pageUrl } from '../../lib/posts';
|
||||||
|
|
||||||
|
export interface Props {
|
||||||
|
current: number;
|
||||||
|
total: number;
|
||||||
|
/** URL of page 1, e.g. `/blog/`. */
|
||||||
|
base: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { current, total, base } = Astro.props;
|
||||||
|
|
||||||
|
// 1 … (current-1) current (current+1) … total
|
||||||
|
const numbers: (number | 'gap')[] = [];
|
||||||
|
for (let n = 1; n <= total; n++) {
|
||||||
|
if (n === 1 || n === total || Math.abs(n - current) <= 1) numbers.push(n);
|
||||||
|
else if (numbers.at(-1) !== 'gap') numbers.push('gap');
|
||||||
|
}
|
||||||
|
|
||||||
|
const controls = [
|
||||||
|
{ label: blog.pager.first, icon: 'tabler:chevrons-left', page: 1, enabled: current > 1 },
|
||||||
|
{ label: blog.pager.prev, icon: 'tabler:chevron-left', page: current - 1, enabled: current > 1 },
|
||||||
|
];
|
||||||
|
const after = [
|
||||||
|
{
|
||||||
|
label: blog.pager.next,
|
||||||
|
icon: 'tabler:chevron-right',
|
||||||
|
page: current + 1,
|
||||||
|
enabled: current < total,
|
||||||
|
},
|
||||||
|
{ label: blog.pager.last, icon: 'tabler:chevrons-right', page: total, enabled: current < total },
|
||||||
|
];
|
||||||
|
const item =
|
||||||
|
'font-display inline-flex h-10 min-w-10 items-center justify-center gap-1 border px-3 text-sm font-bold';
|
||||||
|
---
|
||||||
|
|
||||||
|
{total > 1 && (
|
||||||
|
<nav aria-label={blog.pager.label} class="mt-12 flex justify-center">
|
||||||
|
<ul class="flex flex-wrap items-center justify-center gap-2">
|
||||||
|
{controls.map((c) => (
|
||||||
|
<li>
|
||||||
|
{c.enabled ? (
|
||||||
|
<a href={pageUrl(base, c.page)} class:list={[item, 'border-line hover:border-fg']}>
|
||||||
|
{c.icon.includes('chevrons') ? null : (
|
||||||
|
<Icon name={c.icon} class="size-4" aria-hidden="true" />
|
||||||
|
)}
|
||||||
|
{c.label}
|
||||||
|
</a>
|
||||||
|
) : (
|
||||||
|
<span
|
||||||
|
aria-disabled="true"
|
||||||
|
class:list={[item, 'border-line text-fg-muted cursor-not-allowed border-dashed']}
|
||||||
|
>
|
||||||
|
{c.label}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
{numbers.map((n) => (
|
||||||
|
<li>
|
||||||
|
{n === 'gap' ? (
|
||||||
|
<span class="px-1" aria-hidden="true">
|
||||||
|
…
|
||||||
|
</span>
|
||||||
|
) : n === current ? (
|
||||||
|
<span aria-current="page" class:list={[item, 'bg-fg text-bg border-fg']}>
|
||||||
|
<span class="sr-only">{fmt(blog.pager.page, { n })}</span>
|
||||||
|
<span aria-hidden="true">{n}</span>
|
||||||
|
</span>
|
||||||
|
) : (
|
||||||
|
<a href={pageUrl(base, n)} class:list={[item, 'border-line hover:border-fg']}>
|
||||||
|
<span class="sr-only">{fmt(blog.pager.page, { n })}</span>
|
||||||
|
<span aria-hidden="true">{n}</span>
|
||||||
|
</a>
|
||||||
|
)}
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
{after.map((c) => (
|
||||||
|
<li>
|
||||||
|
{c.enabled ? (
|
||||||
|
<a href={pageUrl(base, c.page)} class:list={[item, 'border-line hover:border-fg']}>
|
||||||
|
{c.label}
|
||||||
|
{c.icon.includes('chevrons') ? null : (
|
||||||
|
<Icon name={c.icon} class="size-4" aria-hidden="true" />
|
||||||
|
)}
|
||||||
|
</a>
|
||||||
|
) : (
|
||||||
|
<span
|
||||||
|
aria-disabled="true"
|
||||||
|
class:list={[item, 'border-line text-fg-muted cursor-not-allowed border-dashed']}
|
||||||
|
>
|
||||||
|
{c.label}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
)}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
---
|
||||||
|
import { Image } from 'astro:assets';
|
||||||
|
import { Icon } from 'astro-icon/components';
|
||||||
|
import { categoryOf, categoryUrl, postUrl, readingMinutes, type Post } from '../../lib/posts';
|
||||||
|
import Badge from '../Badge.astro';
|
||||||
|
import Card from '../Card.astro';
|
||||||
|
import DateBadges from './DateBadges.astro';
|
||||||
|
|
||||||
|
export interface Props {
|
||||||
|
post: Post;
|
||||||
|
/** `row`: blog list (cover beside text on md+); `stack`: grid card. */
|
||||||
|
layout?: 'row' | 'stack';
|
||||||
|
headingLevel?: 2 | 3;
|
||||||
|
/** Eager-load the cover (first card above the fold). */
|
||||||
|
priority?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { post, layout = 'row', headingLevel = 2, priority = false } = Astro.props;
|
||||||
|
const { title, description, cover, coverAlt, pubDate, updatedDate } = post.data;
|
||||||
|
const category = categoryOf(post);
|
||||||
|
const Heading = `h${headingLevel}` as 'h2' | 'h3';
|
||||||
|
const row = layout === 'row';
|
||||||
|
---
|
||||||
|
|
||||||
|
<Card
|
||||||
|
interactive
|
||||||
|
class:list={['w-full', row && 'md:grid md:grid-cols-[minmax(0,2fr)_minmax(0,3fr)]']}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class:list={['bg-bg-alt relative aspect-[1200/630] overflow-hidden', row && 'md:aspect-auto']}
|
||||||
|
>
|
||||||
|
{cover ? (
|
||||||
|
<Image
|
||||||
|
src={cover}
|
||||||
|
alt={coverAlt ?? ''}
|
||||||
|
widths={[400, 640, 960]}
|
||||||
|
sizes={row ? '(min-width: 768px) 320px, 100vw' : '(min-width: 1024px) 400px, 100vw'}
|
||||||
|
loading={priority ? 'eager' : 'lazy'}
|
||||||
|
fetchpriority={priority ? 'high' : 'auto'}
|
||||||
|
class="h-full w-full object-cover"
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<div class="flex h-full min-h-40 items-center justify-center" aria-hidden="true">
|
||||||
|
<Icon name={category.icon} class="text-fg/40 size-16" />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-1 flex-col gap-3 p-6">
|
||||||
|
<Badge variant="category" href={categoryUrl(category.slug)} class="relative z-10">
|
||||||
|
{category.name}
|
||||||
|
</Badge>
|
||||||
|
<Heading class:list={['leading-tight font-bold', row ? 'text-2xl' : 'text-xl']}>
|
||||||
|
<a href={postUrl(post)} class="after:absolute after:inset-0 hover:underline">
|
||||||
|
{title}
|
||||||
|
</a>
|
||||||
|
</Heading>
|
||||||
|
<p class="text-fg-muted">{description}</p>
|
||||||
|
<DateBadges
|
||||||
|
pubDate={pubDate}
|
||||||
|
updatedDate={updatedDate}
|
||||||
|
minutes={readingMinutes(post)}
|
||||||
|
class="mt-auto pt-2"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
---
|
||||||
|
// Pagefind search (index is built after `astro build`; unavailable in `astro dev`).
|
||||||
|
import { Icon } from 'astro-icon/components';
|
||||||
|
import { blog } from '../../lib/data';
|
||||||
|
---
|
||||||
|
|
||||||
|
<div
|
||||||
|
data-search
|
||||||
|
data-no-results={blog.sidebar.searchNoResults}
|
||||||
|
data-results={blog.sidebar.searchResults}
|
||||||
|
data-unavailable={blog.sidebar.searchUnavailable}
|
||||||
|
>
|
||||||
|
<form role="search" class="relative">
|
||||||
|
<label for="search-input" class="sr-only">
|
||||||
|
{blog.sidebar.searchLabel}
|
||||||
|
</label>
|
||||||
|
<Icon
|
||||||
|
name="tabler:search"
|
||||||
|
class="text-fg-muted pointer-events-none absolute top-1/2 left-3 size-5 -translate-y-1/2"
|
||||||
|
aria-hidden="true"
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
id="search-input"
|
||||||
|
type="search"
|
||||||
|
autocomplete="off"
|
||||||
|
placeholder={blog.sidebar.searchPlaceholder}
|
||||||
|
class="border-fg bg-surface placeholder:text-fg-muted w-full border py-2.5 pr-3 pl-10"
|
||||||
|
/>
|
||||||
|
</form>
|
||||||
|
<p data-search-status aria-live="polite" class="text-fg-muted mt-2 text-sm empty:hidden"></p>
|
||||||
|
<ul data-search-results class="mt-3 flex flex-col gap-3 empty:hidden"></ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
type PagefindResult = {
|
||||||
|
url: string;
|
||||||
|
excerpt: string;
|
||||||
|
meta: { title?: string };
|
||||||
|
};
|
||||||
|
type Pagefind = {
|
||||||
|
options: (o: Record<string, unknown>) => Promise<void>;
|
||||||
|
debouncedSearch: (
|
||||||
|
q: string,
|
||||||
|
o?: unknown,
|
||||||
|
ms?: number,
|
||||||
|
) => Promise<{ results: { data: () => Promise<PagefindResult> }[] } | null>;
|
||||||
|
};
|
||||||
|
|
||||||
|
for (const root of document.querySelectorAll<HTMLElement>('[data-search]')) {
|
||||||
|
const input = root.querySelector('input')!;
|
||||||
|
root.querySelector('form')!.addEventListener('submit', (e) => e.preventDefault());
|
||||||
|
const status = root.querySelector<HTMLElement>('[data-search-status]')!;
|
||||||
|
const list = root.querySelector<HTMLUListElement>('[data-search-results]')!;
|
||||||
|
let pagefind: Pagefind | null | undefined;
|
||||||
|
|
||||||
|
const load = async () => {
|
||||||
|
if (pagefind !== undefined) return pagefind;
|
||||||
|
try {
|
||||||
|
const url = '/pagefind/pagefind.js';
|
||||||
|
pagefind = (await import(/* @vite-ignore */ url)) as Pagefind;
|
||||||
|
await pagefind.options({ excerptLength: 20 });
|
||||||
|
} catch {
|
||||||
|
pagefind = null;
|
||||||
|
}
|
||||||
|
return pagefind;
|
||||||
|
};
|
||||||
|
|
||||||
|
input.addEventListener('focus', () => void load(), { once: true });
|
||||||
|
input.addEventListener('input', async () => {
|
||||||
|
const q = input.value.trim();
|
||||||
|
const pf = await load();
|
||||||
|
if (!pf) {
|
||||||
|
status.textContent = root.dataset.unavailable ?? '';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const search = await pf.debouncedSearch(q, {}, 250);
|
||||||
|
if (search === null) return; // superseded by a newer keystroke
|
||||||
|
list.replaceChildren();
|
||||||
|
if (!q) {
|
||||||
|
status.textContent = '';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const items = await Promise.all(search.results.slice(0, 6).map((r) => r.data()));
|
||||||
|
status.textContent = items.length
|
||||||
|
? (root.dataset.results ?? '').replace('{n}', String(search.results.length))
|
||||||
|
: (root.dataset.noResults ?? '');
|
||||||
|
for (const item of items) {
|
||||||
|
const li = document.createElement('li');
|
||||||
|
const a = document.createElement('a');
|
||||||
|
a.href = item.url;
|
||||||
|
a.className = 'font-bold hover:underline';
|
||||||
|
a.textContent = item.meta.title ?? item.url;
|
||||||
|
const p = document.createElement('p');
|
||||||
|
p.className = 'text-fg-muted text-sm [&_mark]:bg-khaki [&_mark]:text-ink';
|
||||||
|
p.innerHTML = item.excerpt; // Pagefind escapes content; only <mark> is HTML
|
||||||
|
li.append(a, p);
|
||||||
|
list.append(li);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
---
|
||||||
|
import { Icon } from 'astro-icon/components';
|
||||||
|
import { blog, site } from '../../lib/data';
|
||||||
|
|
||||||
|
export interface Props {
|
||||||
|
url: string;
|
||||||
|
title: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { url, title } = Astro.props;
|
||||||
|
const fill = (tpl: string) =>
|
||||||
|
tpl.replace('{url}', encodeURIComponent(url)).replace('{title}', encodeURIComponent(title));
|
||||||
|
const btn =
|
||||||
|
'border-line hover:border-fg hover:bg-fg hover:text-bg inline-flex size-11 cursor-pointer items-center justify-center border transition-colors';
|
||||||
|
---
|
||||||
|
|
||||||
|
<div data-share data-url={url} data-title={title} data-copied={blog.post.copied}>
|
||||||
|
<p class="font-display mb-3 text-sm font-bold tracking-wide uppercase" id="share-label">
|
||||||
|
{blog.post.shareLabel}
|
||||||
|
</p>
|
||||||
|
<ul class="flex flex-wrap gap-2" aria-labelledby="share-label">
|
||||||
|
{blog.share.map((s) => (
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
href={fill(s.url)}
|
||||||
|
target={s.id === 'email' ? undefined : '_blank'}
|
||||||
|
rel={s.id === 'email' ? undefined : 'noopener noreferrer'}
|
||||||
|
title={s.label}
|
||||||
|
class={btn}
|
||||||
|
>
|
||||||
|
<Icon name={s.icon} class="size-5" aria-hidden="true" />
|
||||||
|
<span class="sr-only">
|
||||||
|
{s.label}
|
||||||
|
{s.id !== 'email' && ` ${site.ui.newTab}`}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
<li>
|
||||||
|
<button type="button" data-share-copy title={blog.post.copyLink} class={btn}>
|
||||||
|
<Icon name="tabler:link" class="size-5" aria-hidden="true" />
|
||||||
|
<span class="sr-only">{blog.post.copyLink}</span>
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
<li hidden data-share-native-item>
|
||||||
|
<button type="button" data-share-native title={blog.post.nativeShare} class={btn}>
|
||||||
|
<Icon name="tabler:share" class="size-5" aria-hidden="true" />
|
||||||
|
<span class="sr-only">{blog.post.nativeShare}</span>
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<p
|
||||||
|
data-share-status
|
||||||
|
role="status"
|
||||||
|
aria-live="polite"
|
||||||
|
class="text-accent-text mt-2 min-h-5 text-sm font-semibold"
|
||||||
|
></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
for (const root of document.querySelectorAll<HTMLElement>('[data-share]')) {
|
||||||
|
const { url = location.href, title = document.title, copied = '' } = root.dataset;
|
||||||
|
const status = root.querySelector<HTMLElement>('[data-share-status]')!;
|
||||||
|
|
||||||
|
root.querySelector('[data-share-copy]')?.addEventListener('click', async () => {
|
||||||
|
try {
|
||||||
|
await navigator.clipboard.writeText(url);
|
||||||
|
status.textContent = copied;
|
||||||
|
setTimeout(() => (status.textContent = ''), 2500);
|
||||||
|
} catch {
|
||||||
|
prompt('', url);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (typeof navigator.share === 'function') {
|
||||||
|
root.querySelector<HTMLElement>('[data-share-native-item]')!.hidden = false;
|
||||||
|
root.querySelector('[data-share-native]')!.addEventListener('click', () => {
|
||||||
|
navigator.share({ url, title }).catch(() => {});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,151 @@
|
|||||||
|
---
|
||||||
|
import { blog } from '../../lib/data';
|
||||||
|
import {
|
||||||
|
categoryCounts,
|
||||||
|
categoryUrl,
|
||||||
|
featuredPosts,
|
||||||
|
postUrl,
|
||||||
|
tagCounts,
|
||||||
|
tagUrl,
|
||||||
|
type Post,
|
||||||
|
} from '../../lib/posts';
|
||||||
|
import SearchBox from './SearchBox.astro';
|
||||||
|
import { Icon } from 'astro-icon/components';
|
||||||
|
|
||||||
|
export interface Props {
|
||||||
|
/** All published posts (not just the current page). */
|
||||||
|
posts: Post[];
|
||||||
|
/** Highlights the current category in the list. */
|
||||||
|
activeCategory?: string;
|
||||||
|
activeTag?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { posts, activeCategory, activeTag } = Astro.props;
|
||||||
|
const cats = categoryCounts(posts);
|
||||||
|
const featured = featuredPosts(posts);
|
||||||
|
const tags = tagCounts(posts);
|
||||||
|
const max = Math.max(1, ...tags.map((t) => t.count));
|
||||||
|
// 4 size steps by relative frequency.
|
||||||
|
const tagSize = (count: number) =>
|
||||||
|
['text-sm', 'text-base', 'text-lg', 'text-xl'][Math.min(3, Math.floor((count / max) * 3.999))];
|
||||||
|
const box = 'border-line bg-surface border p-5';
|
||||||
|
const title = 'font-display mb-4 flex items-center gap-3 text-sm font-bold tracking-wide uppercase';
|
||||||
|
---
|
||||||
|
|
||||||
|
<aside aria-label={blog.sidebar.label} class="flex flex-col gap-6">
|
||||||
|
<section class={box} aria-labelledby="sb-search">
|
||||||
|
<h2 id="sb-search" class={title}>
|
||||||
|
{blog.sidebar.search}
|
||||||
|
<span aria-hidden="true" class="bg-accent h-0.5 w-8"></span>
|
||||||
|
</h2>
|
||||||
|
<SearchBox />
|
||||||
|
</section>
|
||||||
|
|
||||||
|
{cats.length > 0 && (
|
||||||
|
<section class={box} aria-labelledby="sb-categories">
|
||||||
|
<h2 id="sb-categories" class={title}>
|
||||||
|
{blog.sidebar.categories}
|
||||||
|
<span aria-hidden="true" class="bg-accent h-0.5 w-8"></span>
|
||||||
|
</h2>
|
||||||
|
<ul class="flex flex-col">
|
||||||
|
{cats.map(({ category, count }) => (
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
href={categoryUrl(category.slug)}
|
||||||
|
aria-current={activeCategory === category.slug ? 'page' : undefined}
|
||||||
|
class="border-line hover:text-accent-text aria-[current=page]:text-accent-text flex items-center gap-2 border-b py-2 aria-[current=page]:font-bold"
|
||||||
|
>
|
||||||
|
<Icon name={category.icon} class="size-5 shrink-0" aria-hidden="true" />
|
||||||
|
<span class="flex-1">{category.name}</span>
|
||||||
|
<span class="font-display text-fg-muted text-sm font-bold">{count}</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{featured.length > 0 && (
|
||||||
|
<section class={box} aria-labelledby="sb-featured">
|
||||||
|
<h2 id="sb-featured" class={title}>
|
||||||
|
{blog.sidebar.featured}
|
||||||
|
<span aria-hidden="true" class="bg-accent h-0.5 w-8"></span>
|
||||||
|
</h2>
|
||||||
|
<ol data-featured data-limit="3" class="flex flex-col gap-4">
|
||||||
|
{featured.map((post, i) => (
|
||||||
|
<li class="flex gap-3" data-slug={post.id}>
|
||||||
|
<span
|
||||||
|
aria-hidden="true"
|
||||||
|
class="font-display text-accent-text text-2xl leading-none font-black"
|
||||||
|
>
|
||||||
|
{String(i + 1).padStart(2, '0')}
|
||||||
|
</span>
|
||||||
|
<a href={postUrl(post)} class="leading-snug font-semibold hover:underline">
|
||||||
|
{post.data.title}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ol>
|
||||||
|
</section>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{tags.length > 0 && (
|
||||||
|
<section class={box} aria-labelledby="sb-tags">
|
||||||
|
<h2 id="sb-tags" class={title}>
|
||||||
|
{blog.sidebar.tags}
|
||||||
|
<span aria-hidden="true" class="bg-accent h-0.5 w-8"></span>
|
||||||
|
</h2>
|
||||||
|
<ul class="flex flex-wrap items-baseline gap-x-3 gap-y-1">
|
||||||
|
{tags.map((t) => (
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
href={tagUrl(t.tag)}
|
||||||
|
aria-current={activeTag === t.slug ? 'page' : undefined}
|
||||||
|
class:list={[
|
||||||
|
'hover:text-accent-text aria-[current=page]:text-accent-text font-semibold hover:underline',
|
||||||
|
tagSize(t.count),
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
#{t.tag}
|
||||||
|
<span class="sr-only">({t.count})</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
)}
|
||||||
|
</aside>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Replace the build-time fallback with the most viewed posts when the API is reachable.
|
||||||
|
const list = document.querySelector<HTMLOListElement>('ol[data-featured]');
|
||||||
|
if (list) {
|
||||||
|
const limit = Number(list.dataset.limit) || 3;
|
||||||
|
fetch(`/api/views/top/?limit=${limit}`)
|
||||||
|
.then((r) => (r.ok ? r.json() : []))
|
||||||
|
.then((top: { slug: string; title: string; url: string }[]) => {
|
||||||
|
if (!top.length) return;
|
||||||
|
const template = list.querySelector('li');
|
||||||
|
if (!template) return;
|
||||||
|
const fallback = [...list.querySelectorAll<HTMLLIElement>('li')];
|
||||||
|
const items = top.map((t) => {
|
||||||
|
const li = template.cloneNode(true) as HTMLLIElement;
|
||||||
|
li.dataset.slug = t.slug;
|
||||||
|
const a = li.querySelector('a')!;
|
||||||
|
a.href = t.url;
|
||||||
|
a.textContent = t.title;
|
||||||
|
return li;
|
||||||
|
});
|
||||||
|
// Top up with fallback posts not already listed.
|
||||||
|
for (const li of fallback) {
|
||||||
|
if (items.length >= limit) break;
|
||||||
|
if (!items.some((x) => x.dataset.slug === li.dataset.slug)) items.push(li);
|
||||||
|
}
|
||||||
|
items.forEach((li, i) => {
|
||||||
|
li.querySelector('span')!.textContent = String(i + 1).padStart(2, '0');
|
||||||
|
});
|
||||||
|
list.replaceChildren(...items);
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
---
|
||||||
|
import type { MarkdownHeading } from 'astro';
|
||||||
|
import { blog } from '../../lib/data';
|
||||||
|
|
||||||
|
export interface Props {
|
||||||
|
headings: MarkdownHeading[];
|
||||||
|
}
|
||||||
|
|
||||||
|
const items = Astro.props.headings.filter((h) => h.depth === 2 || h.depth === 3);
|
||||||
|
---
|
||||||
|
|
||||||
|
{items.length >= 2 && (
|
||||||
|
<details open class="border-line bg-surface group border p-5">
|
||||||
|
<summary class="font-display cursor-pointer text-sm font-bold tracking-wide uppercase">
|
||||||
|
{blog.post.toc}
|
||||||
|
</summary>
|
||||||
|
<nav aria-label={blog.post.toc} class="mt-4">
|
||||||
|
<ol class="flex flex-col gap-2">
|
||||||
|
{items.map((h) => (
|
||||||
|
<li class:list={[h.depth === 3 && 'pl-5 text-sm']}>
|
||||||
|
<a href={`#${h.slug}`} class="decoration-accent underline-offset-4 hover:underline">
|
||||||
|
{h.text}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ol>
|
||||||
|
</nav>
|
||||||
|
</details>
|
||||||
|
)}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
---
|
||||||
|
import { Icon } from 'astro-icon/components';
|
||||||
|
import type { HomeSection } from '../../lib/data';
|
||||||
|
import Card from '../Card.astro';
|
||||||
|
import ExternalLink from '../ExternalLink.astro';
|
||||||
|
import Section from '../Section.astro';
|
||||||
|
import SectionHeading from '../SectionHeading.astro';
|
||||||
|
|
||||||
|
export interface Props {
|
||||||
|
section: Extract<HomeSection, { type: 'cards' }>;
|
||||||
|
alt: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { section, alt } = Astro.props;
|
||||||
|
const headingId = `${section.id}-title`;
|
||||||
|
const display = (href: string) => {
|
||||||
|
const u = new URL(href);
|
||||||
|
return (u.host + u.pathname).replace(/^www\./, '').replace(/\/$/, '');
|
||||||
|
};
|
||||||
|
---
|
||||||
|
|
||||||
|
<Section id={section.id} alt={alt} labelledby={headingId}>
|
||||||
|
<SectionHeading id={headingId} eyebrow={section.eyebrow} title={section.title} />
|
||||||
|
<ul class="mt-10 grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
|
||||||
|
{section.items.map((item) => (
|
||||||
|
<li class="flex">
|
||||||
|
<Card interactive class="w-full">
|
||||||
|
<div class="flex flex-1 flex-col gap-4 p-6">
|
||||||
|
<span class="bg-bg-alt text-fg inline-flex size-12 items-center justify-center">
|
||||||
|
<Icon name={item.icon} class="size-6" aria-hidden="true" />
|
||||||
|
</span>
|
||||||
|
<h3 class="text-xl leading-snug font-bold">
|
||||||
|
<ExternalLink
|
||||||
|
href={item.href}
|
||||||
|
icon={false}
|
||||||
|
class="after:absolute after:inset-0 hover:underline"
|
||||||
|
>
|
||||||
|
{item.title}
|
||||||
|
</ExternalLink>
|
||||||
|
</h3>
|
||||||
|
{item.description && <p class="text-fg-muted text-sm">{item.description}</p>}
|
||||||
|
<p class="text-accent-text mt-auto inline-flex items-center gap-1 text-sm font-semibold">
|
||||||
|
{display(item.href)}
|
||||||
|
<Icon name="tabler:external-link" class="size-4" aria-hidden="true" />
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
</Section>
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
---
|
||||||
|
import { Icon } from 'astro-icon/components';
|
||||||
|
import type { HomeSection } from '../../lib/data';
|
||||||
|
import Badge from '../Badge.astro';
|
||||||
|
import Button from '../Button.astro';
|
||||||
|
import ExternalLink from '../ExternalLink.astro';
|
||||||
|
import Section from '../Section.astro';
|
||||||
|
import SectionHeading from '../SectionHeading.astro';
|
||||||
|
import Numeral from './Numeral.astro';
|
||||||
|
|
||||||
|
export interface Props {
|
||||||
|
section: Extract<HomeSection, { type: 'feature' }>;
|
||||||
|
index: number;
|
||||||
|
alt: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { section, index, alt } = Astro.props;
|
||||||
|
const headingId = `${section.id}-title`;
|
||||||
|
const host = new URL(section.link.href).host.replace(/^www\./, '');
|
||||||
|
---
|
||||||
|
|
||||||
|
<Section id={section.id} alt={alt} labelledby={headingId}>
|
||||||
|
<div class="grid gap-8 md:grid-cols-[1.4fr_1.6fr_4.2fr] md:gap-0">
|
||||||
|
<div class="flex flex-col gap-6 md:col-start-3 md:row-start-1 md:pl-8">
|
||||||
|
<SectionHeading id={headingId} eyebrow={section.eyebrow} title={section.title} />
|
||||||
|
<p class="max-w-prose text-lg">{section.body}</p>
|
||||||
|
<Button href={section.link.href} external icon="tabler:arrow-up-right" class="self-start">
|
||||||
|
{section.link.label}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-center gap-4 md:col-start-1 md:row-start-1 md:flex-col md:items-start">
|
||||||
|
<Numeral
|
||||||
|
value={String(index).padStart(2, '0')}
|
||||||
|
alt={alt}
|
||||||
|
class="hidden text-[clamp(4rem,8vw,7rem)] md:block"
|
||||||
|
/>
|
||||||
|
<Icon name={section.icon} class="size-10" aria-hidden="true" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<dl class="flex flex-col gap-4 text-sm md:col-start-2 md:row-start-1 md:px-6 md:pt-2">
|
||||||
|
{section.callsign && (
|
||||||
|
<div class="flex flex-col gap-1">
|
||||||
|
<dt class="font-display font-bold tracking-wide uppercase">{section.callsignLabel}</dt>
|
||||||
|
<dd>
|
||||||
|
<Badge icon="tabler:antenna">{section.callsign}</Badge>
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<div class="flex flex-col gap-1">
|
||||||
|
<dt class="sr-only">Web</dt>
|
||||||
|
<dd>
|
||||||
|
<ExternalLink href={section.link.href} class="link-strong text-base">
|
||||||
|
{host}
|
||||||
|
</ExternalLink>
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
</Section>
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
---
|
||||||
|
import { Icon } from 'astro-icon/components';
|
||||||
|
import { home } from '../../lib/data';
|
||||||
|
import Button from '../Button.astro';
|
||||||
|
import Section from '../Section.astro';
|
||||||
|
import SectionHeading from '../SectionHeading.astro';
|
||||||
|
import Numeral from './Numeral.astro';
|
||||||
|
|
||||||
|
const { hero } = home;
|
||||||
|
---
|
||||||
|
|
||||||
|
<Section alt labelledby="hero-title" class="md:py-28">
|
||||||
|
<div class="grid gap-10 md:grid-cols-[1.4fr_1.6fr_4.2fr] md:gap-0">
|
||||||
|
<div class="flex flex-col gap-8 md:col-start-3 md:row-start-1 md:pl-8">
|
||||||
|
<SectionHeading level={1} id="hero-title" eyebrow={hero.eyebrow} title={hero.title} />
|
||||||
|
<p class="max-w-xl text-lg">{hero.lead}</p>
|
||||||
|
<div class="flex flex-wrap gap-4">
|
||||||
|
{hero.ctas.map((cta) => (
|
||||||
|
<Button href={cta.href} variant={cta.variant} icon={cta.icon}>
|
||||||
|
{cta.label}
|
||||||
|
</Button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-col gap-6 md:col-start-1 md:row-start-1 md:pr-6">
|
||||||
|
<Numeral value={hero.numeral} alt class="hidden text-[clamp(5rem,9vw,8rem)] md:block" />
|
||||||
|
<ul class="flex flex-wrap gap-2 md:flex-col md:items-start">
|
||||||
|
{hero.tags.map((tag) => (
|
||||||
|
<li class="font-display border-fg inline-flex items-center gap-1.5 border px-2 py-1 text-xs font-bold tracking-wide uppercase">
|
||||||
|
<Icon name={tag.icon} class="size-4" aria-hidden="true" />
|
||||||
|
{tag.label}
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-col gap-4 md:col-start-2 md:row-start-1 md:px-6">
|
||||||
|
<p class="font-display text-2xl leading-tight font-bold">{hero.asideTitle}</p>
|
||||||
|
<p class="text-sm">{hero.asideBody}</p>
|
||||||
|
<Button href={hero.asideLink.href} variant="link" class="self-start">
|
||||||
|
{hero.asideLink.label}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Section>
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
---
|
||||||
|
// Latest posts block. Post cards are passed through the default slot (wired up in stage 4).
|
||||||
|
import type { HomeSection } from '../../lib/data';
|
||||||
|
import Button from '../Button.astro';
|
||||||
|
import Section from '../Section.astro';
|
||||||
|
import SectionHeading from '../SectionHeading.astro';
|
||||||
|
|
||||||
|
export interface Props {
|
||||||
|
section: Extract<HomeSection, { type: 'latestPosts' }>;
|
||||||
|
alt: boolean;
|
||||||
|
hasPosts: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { section, alt, hasPosts } = Astro.props;
|
||||||
|
const headingId = `${section.id}-title`;
|
||||||
|
---
|
||||||
|
|
||||||
|
<Section id={section.id} alt={alt} labelledby={headingId}>
|
||||||
|
<div class="flex flex-wrap items-end justify-between gap-6">
|
||||||
|
<SectionHeading id={headingId} eyebrow={section.eyebrow} title={section.title} />
|
||||||
|
{hasPosts && (
|
||||||
|
<Button href={section.allLink.href} variant="link" icon="tabler:arrow-right">
|
||||||
|
{section.allLink.label}
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{hasPosts ? (
|
||||||
|
<div class="mt-10">
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<p class="border-fg/30 mt-10 border-2 border-dashed p-8 text-center text-lg">{section.empty}</p>
|
||||||
|
)}
|
||||||
|
</Section>
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
// Giant decorative numeral (reference: Paper-coloured "2" on khaki).
|
||||||
|
// Rendered via ::before so it is not text content (no a11y/contrast noise).
|
||||||
|
export interface Props {
|
||||||
|
value: string;
|
||||||
|
alt?: boolean;
|
||||||
|
class?: string;
|
||||||
|
}
|
||||||
|
const { value, alt = false, class: className } = Astro.props;
|
||||||
|
---
|
||||||
|
|
||||||
|
<span
|
||||||
|
aria-hidden="true"
|
||||||
|
data-numeral={value}
|
||||||
|
class:list={[
|
||||||
|
'font-display block leading-[0.8] font-black tracking-tighter select-none before:content-[attr(data-numeral)]',
|
||||||
|
alt ? 'text-paper dark:text-fg/15' : 'text-bg-alt dark:text-fg/15',
|
||||||
|
className,
|
||||||
|
]}
|
||||||
|
></span>
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
import { defineCollection } from 'astro:content';
|
||||||
|
import { glob } from 'astro/loaders';
|
||||||
|
import { z } from 'astro/zod';
|
||||||
|
|
||||||
|
// One folder per post: src/content/blog/<slug>/index.md(x) + its images.
|
||||||
|
const blog = defineCollection({
|
||||||
|
loader: glob({
|
||||||
|
pattern: '**/index.{md,mdx}',
|
||||||
|
base: './src/content/blog',
|
||||||
|
generateId: ({ entry }) => entry.replace(/\/index\.mdx?$/, ''),
|
||||||
|
}),
|
||||||
|
schema: ({ image }) =>
|
||||||
|
z
|
||||||
|
.object({
|
||||||
|
title: z.string().max(70),
|
||||||
|
description: z.string().min(50).max(160),
|
||||||
|
pubDate: z.coerce.date(),
|
||||||
|
updatedDate: z.coerce.date().optional(),
|
||||||
|
category: z.string(), // must exist in src/data/categories.json (checked in lib/posts.ts)
|
||||||
|
tags: z.array(z.string()).default([]),
|
||||||
|
cover: image().optional(),
|
||||||
|
coverAlt: z.string().optional(),
|
||||||
|
featured: z.boolean().default(false),
|
||||||
|
diy: z.boolean().default(false),
|
||||||
|
draft: z.boolean().default(false),
|
||||||
|
})
|
||||||
|
.refine((d) => !d.cover || !!d.coverAlt, {
|
||||||
|
message: 'coverAlt is required when cover is set',
|
||||||
|
path: ['coverAlt'],
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
// Legal pages: src/content/legal/<slug>.md → /<slug>/
|
||||||
|
const legal = defineCollection({
|
||||||
|
loader: glob({ pattern: '*.md', base: './src/content/legal' }),
|
||||||
|
schema: z.object({
|
||||||
|
title: z.string().max(60),
|
||||||
|
description: z.string().min(50).max(160),
|
||||||
|
updated: z.coerce.date(),
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
export const collections = { blog, legal };
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
---
|
||||||
|
title: "DMR'ye Giriş: Talkgroup, Timeslot ve Color Code"
|
||||||
|
description: "DMR'de talkgroup, timeslot, color code ve codeplug kavramlarına kısa bir giriş. Dijital sese yeni başlayanlar için temel terimler."
|
||||||
|
pubDate: 2026-10-01
|
||||||
|
category: 'dmr'
|
||||||
|
tags: ['dmr', 'talkgroup', 'codeplug', 'örnek']
|
||||||
|
featured: true
|
||||||
|
---
|
||||||
|
|
||||||
|
> **Not:** Bu bir **örnek yazıdır**; sitenin blog altyapısını göstermek için eklenmiştir ve daha sonra kaldırılabilir.
|
||||||
|
|
||||||
|
DMR (Digital Mobile Radio), ETSI tarafından standartlaştırılmış dijital bir telsiz haberleşme sistemidir. Analog FM'den farklı olarak sesi sayısal veriye çevirir ve aynı kanalı zaman paylaşımıyla iki konuşmaya böler.
|
||||||
|
|
||||||
|
## Timeslot (Zaman Dilimi)
|
||||||
|
|
||||||
|
DMR, TDMA (Time Division Multiple Access) kullanır. 12,5 kHz'lik bir kanal **iki zaman dilimine** (TS1 ve TS2) ayrılır; böylece aynı frekans üzerinden iki ayrı konuşma aynı anda taşınabilir.
|
||||||
|
|
||||||
|
## Talkgroup
|
||||||
|
|
||||||
|
Talkgroup (TG), bir grup kullanıcının ortak olarak dinlediği sanal bir "konuşma odası"dır. Cihazınızda bir TG seçtiğinizde, yalnızca o gruba yapılan çağrıları duyarsınız.
|
||||||
|
|
||||||
|
| Kavram | Kısaca |
|
||||||
|
| ------------ | ---------------------------------- |
|
||||||
|
| Talkgroup | Grup çağrısının hedefi |
|
||||||
|
| Private Call | Tek bir DMR ID'ye yapılan çağrı |
|
||||||
|
| Timeslot | Kanalın iki zaman diliminden biri |
|
||||||
|
| Color Code | Röle/kanal ayırt edici kodu (0–15) |
|
||||||
|
|
||||||
|
## Color Code
|
||||||
|
|
||||||
|
Color Code, analogdaki CTCSS tonuna benzer bir işlev görür: cihaz yalnızca doğru color code ile gelen sinyali çözer. Röleye erişirken rölenin kullandığı color code ile aynı değeri ayarlamanız gerekir.
|
||||||
|
|
||||||
|
## Codeplug
|
||||||
|
|
||||||
|
Codeplug, cihazınızın kanal, kontak (talkgroup listesi), zone ve tarama ayarlarını içeren yapılandırma dosyasıdır. Çoğu cihazda üreticinin programlama yazılımıyla hazırlanır ve kablo ile cihaza yüklenir.
|
||||||
|
|
||||||
|
## Sonuç
|
||||||
|
|
||||||
|
DMR'ye başlarken bu dört kavramı oturtmak, codeplug hazırlamayı ve röle kullanımını çok kolaylaştırır.
|
||||||
|
|
||||||
|
73 de TA1SPH
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
---
|
||||||
|
title: 'Röle Kullanırken CTCSS Tonu Neden Gerekli?'
|
||||||
|
description: 'Analog röleye erişimde CTCSS (alt ses tonu) ne işe yarar, Tx ve Rx tonu arasındaki fark nedir? Kısa ve pratik bir açıklama.'
|
||||||
|
pubDate: 2026-10-08
|
||||||
|
updatedDate: 2026-10-15
|
||||||
|
category: 'roleler'
|
||||||
|
tags: ['röle', 'ctcss', 'uhf', 'örnek']
|
||||||
|
---
|
||||||
|
|
||||||
|
> **Not:** Bu bir **örnek yazıdır**; sitenin blog altyapısını göstermek için eklenmiştir ve daha sonra kaldırılabilir.
|
||||||
|
|
||||||
|
Birçok analog röle, yalnızca belirli bir **alt ses tonu** (CTCSS) taşıyan sinyallere yanıt verir. Bu sayede aynı frekansı paylaşan istasyonlar ya da parazitler röleyi gereksiz yere açmaz.
|
||||||
|
|
||||||
|
## CTCSS nedir?
|
||||||
|
|
||||||
|
CTCSS (Continuous Tone-Coded Squelch System), konuşmanın altına eklenen ve kulağın pek fark etmediği düşük frekanslı bir tondur (yaklaşık 67–254 Hz aralığında standart değerler). Röle bu tonu duymadan susturucusunu (squelch) açmaz.
|
||||||
|
|
||||||
|
## Tx tonu ve Rx tonu
|
||||||
|
|
||||||
|
- **Tx tonu:** Sizin gönderdiğiniz ton. Röleye erişmek için genellikle bu gereklidir.
|
||||||
|
- **Rx tonu:** Cihazınızın yalnızca bu tonu taşıyan yayınları duyurmasını sağlar. Zorunlu değildir; ama röle de ton gönderiyorsa gürültüyü azaltır.
|
||||||
|
|
||||||
|
Röle listelerinde "Tx CTCSS 88.5 Hz" gibi bir ifade, cihazınızın gönderirken 88,5 Hz tonu eklemesi gerektiği anlamına gelir.
|
||||||
|
|
||||||
|
## Sık yapılan hata
|
||||||
|
|
||||||
|
Röleyi açamıyorsanız önce şunları kontrol edin:
|
||||||
|
|
||||||
|
1. Frekans ve kayma (shift/offset) doğru mu?
|
||||||
|
2. Tx CTCSS tonu açık mı ve değeri doğru mu?
|
||||||
|
3. Cihaz yanlışlıkla DCS moduna mı ayarlı?
|
||||||
|
|
||||||
|
## Sonuç
|
||||||
|
|
||||||
|
Doğru ton ayarı, röleye sorunsuz erişimin en basit ama en çok atlanan adımıdır.
|
||||||
|
|
||||||
|
73 de TA1SPH
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
---
|
||||||
|
title: 'UHF Ground Plane Anten: Çalışma Mantığı ve Boy Hesabı'
|
||||||
|
description: 'Çeyrek dalga ground plane antenin çalışma mantığı, radyallerin görevi ve UHF için yaklaşık eleman boyunun nasıl hesaplandığı.'
|
||||||
|
pubDate: 2026-10-14
|
||||||
|
category: 'antenler'
|
||||||
|
tags: ['anten', 'uhf', 'ground plane', 'diy', 'örnek']
|
||||||
|
diy: true
|
||||||
|
---
|
||||||
|
|
||||||
|
> **Not:** Bu bir **örnek yazıdır**; sitenin blog altyapısını göstermek için eklenmiştir ve daha sonra kaldırılabilir.
|
||||||
|
|
||||||
|
Ground plane, yapımı en kolay dikey antenlerden biridir: bir adet çeyrek dalga boyunda dikey eleman ve onun altında genellikle dört adet radyal.
|
||||||
|
|
||||||
|
## Çalışma mantığı
|
||||||
|
|
||||||
|
Dikey eleman ışıyan kısımdır. Radyaller ise yapay bir "toprak düzlemi" oluşturur. Radyallere aşağı doğru yaklaşık 45° eğim verildiğinde antenin besleme empedansı 50 Ω'a yaklaşır; yatay radyallerde bu değer daha düşüktür.
|
||||||
|
|
||||||
|
## Boy hesabı
|
||||||
|
|
||||||
|
Serbest uzayda dalga boyu `λ = 300 / f(MHz)` metredir. Çeyrek dalga için bunun dörtte birini alır, iletkenin kısalma etkisi için yaklaşık %5 düşeriz:
|
||||||
|
|
||||||
|
```python
|
||||||
|
def quarter_wave_cm(freq_mhz: float, k: float = 0.95) -> float:
|
||||||
|
"""Approximate quarter-wave element length in centimetres."""
|
||||||
|
return 300 / freq_mhz / 4 * k * 100
|
||||||
|
|
||||||
|
print(round(quarter_wave_cm(435.0), 1)) # ≈ 16.4 cm
|
||||||
|
```
|
||||||
|
|
||||||
|
Bu değer bir **başlangıç noktasıdır**; son ayar SWR ölçerek, elemanı azar azar kısaltarak yapılır.
|
||||||
|
|
||||||
|
## Sonuç
|
||||||
|
|
||||||
|
Ground plane, anten yapımına başlamak için ideal bir projedir: az malzeme, basit hesap ve öğretici bir ayar süreci.
|
||||||
|
|
||||||
|
73 de TA1SPH
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
---
|
||||||
|
title: 'Gizlilik Politikası'
|
||||||
|
description: 'ta1sph.info hangi verileri işler, hangilerini işlemez: çerez yok, takip yok, anonim görüntülenme sayacı. KVKK kapsamındaki haklarınız.'
|
||||||
|
updated: 2026-10-16
|
||||||
|
---
|
||||||
|
|
||||||
|
Bu sayfa, **ta1sph.info** sitesini ziyaret ettiğinizde hangi verilerin işlendiğini 6698 sayılı Kişisel Verilerin Korunması Kanunu (KVKK) çerçevesinde açıklar.
|
||||||
|
|
||||||
|
## Veri sorumlusu
|
||||||
|
|
||||||
|
Suphi Çakır (TA1SPH) · E-posta: suphi@radio.org.tr
|
||||||
|
|
||||||
|
## Kısaca
|
||||||
|
|
||||||
|
- Üyelik, yorum, iletişim formu veya bülten **yoktur**.
|
||||||
|
- Reklam, analiz (analytics) ya da üçüncü taraf takip çerezi **kullanılmaz**.
|
||||||
|
- Site çerez (cookie) yerleştirmez.
|
||||||
|
|
||||||
|
## Tarayıcınızda saklanan bilgi
|
||||||
|
|
||||||
|
Aydınlık/karanlık tema tercihiniz, yalnızca tarayıcınızın yerel depolamasında (`localStorage`, anahtar: `theme`) tutulur. Bu bilgi sunucuya gönderilmez ve kişisel veri değildir. Tarayıcınızın site verilerini silerek kaldırabilirsiniz.
|
||||||
|
|
||||||
|
## Görüntülenme sayacı
|
||||||
|
|
||||||
|
Blog yazılarının kaç kez okunduğunu saymak için anonim bir sayaç kullanılır:
|
||||||
|
|
||||||
|
- IP adresiniz **saklanmaz**. Aynı yazının 24 saat içinde birden fazla sayılmaması için IP adresi, her gün rastgele yenilenen bir değerle (tuz) birlikte tek yönlü olarak özetlenir (hash). Bu özet en fazla 24 saat tutulur ve ardından silinir; eski günlerin tuzları da silindiği için özetler sonradan kimseyle ilişkilendirilemez.
|
||||||
|
- Kalıcı olarak tutulan tek bilgi, her yazının toplam okunma sayısıdır.
|
||||||
|
- Arama motoru botları ve otomatik tarayıcılar sayılmaz.
|
||||||
|
|
||||||
|
## Site içi arama
|
||||||
|
|
||||||
|
Arama, tarayıcınızda çalışır. Yazdığınız arama ifadesi sunucuya gönderilmez ve kaydedilmez.
|
||||||
|
|
||||||
|
## Harita
|
||||||
|
|
||||||
|
İletişim sayfasındaki harita, OpenStreetMap karolarını kullanır. Harita görüntülendiğinde tarayıcınız OpenStreetMap sunucularına bağlanır ve bu sunucular IP adresinizi kendi politikalarına göre işleyebilir: [OSMF Gizlilik Politikası](https://osmfoundation.org/wiki/Privacy_Policy).
|
||||||
|
|
||||||
|
## Paylaşım butonları ve dış bağlantılar
|
||||||
|
|
||||||
|
Yazılardaki paylaşım butonları basit bağlantılardır; sayfa açılırken hiçbir sosyal ağın kodu yüklenmez. Bir butona tıkladığınızda ilgili platforma yönlendirilirsiniz. Telegram, QRZ, sosyal medya ve diğer dış siteler kendi gizlilik politikalarına tabidir.
|
||||||
|
|
||||||
|
Yazı tipleri de dahil olmak üzere sitenin tüm dosyaları bu sunucudan yüklenir; Google Fonts gibi harici servisler kullanılmaz.
|
||||||
|
|
||||||
|
## Sunucu kayıtları
|
||||||
|
|
||||||
|
Site, Türkiye'de bulunan kişisel bir sunucuda barındırılır. Sunucu erişim kayıtları (IP adresi, tarih, istenen sayfa gibi) yalnızca güvenlik ve arıza tespiti amacıyla sınırlı bir süre tutulabilir; başka bir amaçla kullanılmaz ve üçüncü kişilerle paylaşılmaz.
|
||||||
|
|
||||||
|
## Haklarınız
|
||||||
|
|
||||||
|
KVKK'nın 11. maddesi uyarınca; kişisel verilerinizin işlenip işlenmediğini öğrenme, işlenmişse buna ilişkin bilgi talep etme, işlenme amacını öğrenme, aktarıldığı üçüncü kişileri bilme, eksik veya yanlış işlenmişse düzeltilmesini, silinmesini ya da yok edilmesini isteme ve kanuna aykırı işleme nedeniyle zarara uğramanız hâlinde zararın giderilmesini talep etme haklarına sahipsiniz.
|
||||||
|
|
||||||
|
Başvurularınızı **suphi@radio.org.tr** adresine iletebilirsiniz.
|
||||||
|
|
||||||
|
## Değişiklikler
|
||||||
|
|
||||||
|
Bu politika güncellendiğinde sayfanın başındaki tarih değişir.
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
---
|
||||||
|
title: 'Lisans'
|
||||||
|
description: "ta1sph.info'nun kaynak kodu MIT, yazıları ve içeriği CC BY-SA 4.0 lisanslıdır. Kaynak göstererek nasıl kullanabileceğinizi öğrenin."
|
||||||
|
updated: 2026-10-16
|
||||||
|
---
|
||||||
|
|
||||||
|
Bu sitede iki ayrı lisans geçerlidir: biri **kaynak kod**, diğeri **yazılar ve içerik** için.
|
||||||
|
|
||||||
|
## Kaynak kod: MIT Lisansı
|
||||||
|
|
||||||
|
Sitenin kaynak kodu [MIT Lisansı](https://opensource.org/license/mit) ile lisanslanmıştır. Kodu kopyalayabilir, değiştirebilir, dağıtabilir ve ticari amaçla kullanabilirsiniz; tek şart, telif ve lisans bildiriminin korunmasıdır.
|
||||||
|
|
||||||
|
## Yazılar ve içerik: CC BY-SA 4.0
|
||||||
|
|
||||||
|
Makaleler, görseller ve sitedeki diğer içerik [Creative Commons Atıf-AynıLisanslaPaylaş 4.0 Uluslararası (CC BY-SA 4.0)](https://creativecommons.org/licenses/by-sa/4.0/deed.tr) lisansıyla paylaşılır.
|
||||||
|
|
||||||
|
İçeriği kopyalayabilir, yeniden düzenleyebilir ve dağıtabilirsiniz; ticari kullanım dahil. Şartlar şunlardır:
|
||||||
|
|
||||||
|
1. **Atıf:** Kaynak olarak "Suphi Çakır – TA1SPH, ta1sph.info" yazın ve ilgili yazının bağlantısını verin.
|
||||||
|
2. **Lisans bağlantısı:** CC BY-SA 4.0 lisansına bağlantı verin.
|
||||||
|
3. **Değişiklik bildirimi:** İçerikte değişiklik yaptıysanız bunu belirtin.
|
||||||
|
4. **Aynı lisansla paylaşım:** İçerikten türettiğiniz eserleri de CC BY-SA 4.0 ile paylaşın.
|
||||||
|
|
||||||
|
### Örnek atıf
|
||||||
|
|
||||||
|
Aşağıdaki metni kopyalayıp yazının adresiyle birlikte kullanabilirsiniz:
|
||||||
|
|
||||||
|
```text
|
||||||
|
Kaynak: Suphi Çakır – TA1SPH, ta1sph.info — <yazının bağlantısı>
|
||||||
|
Lisans: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/deed.tr
|
||||||
|
```
|
||||||
|
|
||||||
|
## Üçüncü taraf içerik
|
||||||
|
|
||||||
|
Sitede geçen kuruluş adları, logolar ve markalar ile dış kaynaklardan alınmış görseller kendi sahiplerinin lisanslarına tabidir; yukarıdaki lisanslar bunları kapsamaz.
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
---
|
||||||
|
title: 'Sorumluluk Reddi'
|
||||||
|
description: "ta1sph.info'daki DIY anten, cihaz modifikasyonu ve yazılım içerikleri eğitim ve hobi amaçlıdır; uygulamanın tüm sorumluluğu uygulayana aittir."
|
||||||
|
updated: 2026-10-16
|
||||||
|
---
|
||||||
|
|
||||||
|
## Bilgilerin niteliği
|
||||||
|
|
||||||
|
Bu sitedeki yazılar, özellikle **kendin yap (DIY) anten yapımı, cihaz modifikasyonu, güç kaynakları ve yazılım/firmware yükleme** konularındaki içerikler, **eğitim ve hobi amaçlıdır** ve "olduğu gibi" sunulur. Bilgilerin doğruluğu, eksiksizliği, güncelliği veya belirli bir amaca uygunluğu konusunda hiçbir garanti verilmez.
|
||||||
|
|
||||||
|
## Sorumluluk
|
||||||
|
|
||||||
|
Sitedeki uygulamaları gerçekleştirmekten doğabilecek her türlü **maddi veya manevi zarar, cihaz arızası, yaralanma, mülk hasarı, garanti kaybı ve mevzuata aykırılık** sorumluluğu tamamen uygulayan kişiye aittir. İçerikleri uygulayan kişi bu riskleri bilerek ve kabul ederek hareket etmiş sayılır.
|
||||||
|
|
||||||
|
## Lisans ve mevzuat
|
||||||
|
|
||||||
|
Yayın yapabilmek için geçerli bir amatör telsizci lisansına sahip olmak ve Bilgi Teknolojileri ve İletişim Kurumu (BTK) mevzuatına uymak kullanıcının sorumluluğundadır. Lisans sınıfınıza ait frekans ve güç sınırlarına uyun.
|
||||||
|
|
||||||
|
## Güvenlik uyarıları
|
||||||
|
|
||||||
|
- **RF maruziyeti:** Yüksek güçte ve antenlere yakın çalışırken maruziyet sınırlarına dikkat edin.
|
||||||
|
- **Yüksek gerilim:** Güç kaynakları ve amplifikatörler üzerinde çalışmadan önce cihazın enerjisini kesin; kondansatörlerin boşaldığından emin olun.
|
||||||
|
- **Yıldırım ve topraklama:** Dış antenleri ve direkleri uygun şekilde topraklayın; fırtınada anten bağlantılarını ayırın.
|
||||||
|
- **Çatı ve direk çalışmaları:** Yüksekte tek başınıza çalışmayın, uygun emniyet ekipmanı kullanın ve enerji hatlarından uzak durun.
|
||||||
|
|
||||||
|
## Dış bağlantılar
|
||||||
|
|
||||||
|
Bu siteden bağlantı verilen dış sitelerin içeriğinden ve gizlilik uygulamalarından sorumluluk kabul edilmez.
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
---
|
||||||
|
// Dev-only style preview, injected at /styleguide/ by astro.config.mjs (never built for production).
|
||||||
|
// Sample copy below is placeholder text for visual testing only.
|
||||||
|
import Badge from '../components/Badge.astro';
|
||||||
|
import Button from '../components/Button.astro';
|
||||||
|
import Card from '../components/Card.astro';
|
||||||
|
import Container from '../components/Container.astro';
|
||||||
|
import ExternalLink from '../components/ExternalLink.astro';
|
||||||
|
import GridLines from '../components/GridLines.astro';
|
||||||
|
import SectionHeading from '../components/SectionHeading.astro';
|
||||||
|
import BaseLayout from '../layouts/BaseLayout.astro';
|
||||||
|
|
||||||
|
const swatches = [
|
||||||
|
['bg', 'bg-bg'],
|
||||||
|
['bg-alt', 'bg-bg-alt'],
|
||||||
|
['surface', 'bg-surface'],
|
||||||
|
['fg', 'bg-fg'],
|
||||||
|
['fg-muted', 'bg-fg-muted'],
|
||||||
|
['accent', 'bg-accent'],
|
||||||
|
['accent-strong', 'bg-accent-strong'],
|
||||||
|
['accent-fill', 'bg-accent-fill'],
|
||||||
|
];
|
||||||
|
---
|
||||||
|
|
||||||
|
<BaseLayout title="Styleguide" noindex>
|
||||||
|
<section lang="en" class="surface-alt relative overflow-hidden">
|
||||||
|
<GridLines />
|
||||||
|
<Container class="relative grid gap-10 py-20 md:grid-cols-[1.4fr_1.6fr_4.2fr]">
|
||||||
|
<span aria-hidden="true" class="font-display text-paper hidden text-9xl font-black md:block">
|
||||||
|
2
|
||||||
|
</span>
|
||||||
|
<div class="flex flex-col gap-4">
|
||||||
|
<h2 class="font-display text-2xl leading-tight font-bold">Two background colours</h2>
|
||||||
|
<p class="text-sm">Paper ↔ Khaki sections, thin vertical grid lines.</p>
|
||||||
|
<Button href="#" variant="link">
|
||||||
|
Learn More
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
<SectionHeading
|
||||||
|
level={1}
|
||||||
|
eyebrow="Main"
|
||||||
|
title="Content heavy designs require more contrast"
|
||||||
|
/>
|
||||||
|
</Container>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section lang="en" class="py-16">
|
||||||
|
<Container class="flex flex-col gap-10">
|
||||||
|
<SectionHeading eyebrow="Tokens" title="Palette" />
|
||||||
|
<ul class="grid grid-cols-2 gap-4 sm:grid-cols-4">
|
||||||
|
{swatches.map(([name, cls]) => (
|
||||||
|
<li class="border-line border">
|
||||||
|
<div class:list={['h-16', cls]} />
|
||||||
|
<p class="p-2 font-mono text-sm">{name}</p>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
</Container>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section lang="en" class="surface-alt py-16">
|
||||||
|
<Container class="flex flex-col gap-8">
|
||||||
|
<SectionHeading eyebrow="Feature" title="Buttons & badges on khaki" />
|
||||||
|
<div class="flex flex-wrap items-center gap-4">
|
||||||
|
<Button href="#" icon="tabler:arrow-right">
|
||||||
|
Primary
|
||||||
|
</Button>
|
||||||
|
<Button href="#" variant="secondary">
|
||||||
|
Secondary
|
||||||
|
</Button>
|
||||||
|
<Button>Button element</Button>
|
||||||
|
<Button href="#" variant="link">
|
||||||
|
Learn More
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-wrap items-center gap-2">
|
||||||
|
<Badge icon="tabler:refresh">Updated 16 Oct 2026</Badge>
|
||||||
|
<Badge variant="outline" icon="tabler:calendar-plus">
|
||||||
|
Created 1 Oct 2026
|
||||||
|
</Badge>
|
||||||
|
<Badge variant="category" href="#">
|
||||||
|
Category
|
||||||
|
</Badge>
|
||||||
|
</div>
|
||||||
|
<p>
|
||||||
|
Inline{' '}
|
||||||
|
<a href="#" class="decoration-accent underline decoration-2 underline-offset-4">
|
||||||
|
link
|
||||||
|
</a>{' '}
|
||||||
|
and an{' '}
|
||||||
|
<ExternalLink href="https://radio.org.tr" class="underline">
|
||||||
|
external link
|
||||||
|
</ExternalLink>
|
||||||
|
.
|
||||||
|
</p>
|
||||||
|
</Container>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section lang="en" class="py-16">
|
||||||
|
<Container class="flex flex-col gap-8">
|
||||||
|
<SectionHeading eyebrow="Cards" title="Cards on paper" level={2} />
|
||||||
|
<div class="grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
|
||||||
|
{[1, 2, 3].map((n) => (
|
||||||
|
<Card interactive>
|
||||||
|
<div class="flex flex-1 flex-col gap-3 p-6">
|
||||||
|
<Badge variant="category">Category {n}</Badge>
|
||||||
|
<h3 class="text-xl font-bold">
|
||||||
|
<a href="#" class="after:absolute after:inset-0">
|
||||||
|
Card title {n}
|
||||||
|
</a>
|
||||||
|
</h3>
|
||||||
|
<p class="text-fg-muted text-sm">Muted supporting text for the card body.</p>
|
||||||
|
<p class="text-accent-text mt-auto text-sm font-semibold">Small accent text</p>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</Container>
|
||||||
|
</section>
|
||||||
|
</BaseLayout>
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
---
|
||||||
|
import '../styles/global.css';
|
||||||
|
import Footer from '../components/Footer.astro';
|
||||||
|
import Header from '../components/Header.astro';
|
||||||
|
import Seo, { type Props as SeoProps } from '../components/Seo.astro';
|
||||||
|
import ThemeInit from '../components/ThemeInit.astro';
|
||||||
|
import { site } from '../lib/data';
|
||||||
|
|
||||||
|
export type Props = SeoProps;
|
||||||
|
|
||||||
|
const props = Astro.props;
|
||||||
|
---
|
||||||
|
|
||||||
|
<!doctype html>
|
||||||
|
<html lang={site.lang}>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<ThemeInit />
|
||||||
|
<link rel="preload" href="/fonts/rubik-latin.woff2" as="font" type="font/woff2" crossorigin />
|
||||||
|
<link rel="preload" href="/fonts/inter-latin.woff2" as="font" type="font/woff2" crossorigin />
|
||||||
|
<meta name="theme-color" content="#f2efee" media="(prefers-color-scheme: light)" />
|
||||||
|
<meta name="theme-color" content="#111012" media="(prefers-color-scheme: dark)" />
|
||||||
|
<link rel="icon" href="/favicon.ico" sizes="48x48" />
|
||||||
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||||
|
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
||||||
|
<link rel="manifest" href="/site.webmanifest" />
|
||||||
|
<link rel="alternate" type="application/rss+xml" title={site.title} href="/rss.xml" />
|
||||||
|
<meta name="generator" content={Astro.generator} />
|
||||||
|
<Seo {...props} />
|
||||||
|
</head>
|
||||||
|
<body class="flex min-h-dvh flex-col">
|
||||||
|
<a
|
||||||
|
href="#main"
|
||||||
|
class="bg-fg text-bg sr-only z-50 px-4 py-2 font-bold focus:not-sr-only focus:fixed focus:top-2 focus:left-2"
|
||||||
|
>
|
||||||
|
{site.ui.skipToContent}
|
||||||
|
</a>
|
||||||
|
<Header />
|
||||||
|
<main id="main" class="flex-1">
|
||||||
|
<slot />
|
||||||
|
</main>
|
||||||
|
<Footer />
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,271 @@
|
|||||||
|
/**
|
||||||
|
* Typed, validated access to src/data/*.json.
|
||||||
|
* A schema mismatch throws at import time, so `astro build` fails loudly.
|
||||||
|
*/
|
||||||
|
import { z } from 'astro/zod';
|
||||||
|
import siteJson from '../data/site.json';
|
||||||
|
import socialJson from '../data/social.json';
|
||||||
|
import homeJson from '../data/home.json';
|
||||||
|
import categoriesJson from '../data/categories.json';
|
||||||
|
import blogJson from '../data/blog.json';
|
||||||
|
import aboutJson from '../data/about.json';
|
||||||
|
import contactJson from '../data/contact.json';
|
||||||
|
import pagesJson from '../data/pages.json';
|
||||||
|
|
||||||
|
const link = z.object({ label: z.string().min(1), href: z.string().min(1) });
|
||||||
|
const icon = z.string().startsWith('tabler:');
|
||||||
|
|
||||||
|
const siteSchema = z.object({
|
||||||
|
name: z.string(),
|
||||||
|
title: z.string(),
|
||||||
|
description: z.string().max(160),
|
||||||
|
url: z.url(),
|
||||||
|
lang: z.string(),
|
||||||
|
locale: z.string(),
|
||||||
|
titleSeparator: z.string(),
|
||||||
|
author: z.object({ name: z.string(), callsign: z.string(), locator: z.string() }),
|
||||||
|
postsPerPage: z.number().int().positive(),
|
||||||
|
nav: z.array(link).min(1),
|
||||||
|
footer: z.object({
|
||||||
|
about: z.string(),
|
||||||
|
quickLinksTitle: z.string(),
|
||||||
|
legalTitle: z.string(),
|
||||||
|
socialTitle: z.string(),
|
||||||
|
rss: link,
|
||||||
|
legal: z.array(link),
|
||||||
|
license: z.string(),
|
||||||
|
signoff: z.string(),
|
||||||
|
}),
|
||||||
|
ui: z.object({
|
||||||
|
skipToContent: z.string(),
|
||||||
|
mainNav: z.string(),
|
||||||
|
footerNav: z.string(),
|
||||||
|
menuOpen: z.string(),
|
||||||
|
menuClose: z.string(),
|
||||||
|
themeToggle: z.string(),
|
||||||
|
newTab: z.string(),
|
||||||
|
home: z.string(),
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
const socialSchema = z.array(
|
||||||
|
z.object({
|
||||||
|
id: z.string(),
|
||||||
|
label: z.string(),
|
||||||
|
// Empty string = account not set → hidden in the UI.
|
||||||
|
href: z.union([z.url(), z.literal('')]),
|
||||||
|
icon,
|
||||||
|
handle: z.string().optional(),
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
|
const homeSchema = z.object({
|
||||||
|
seo: z.object({ description: z.string().max(160) }),
|
||||||
|
hero: z.object({
|
||||||
|
numeral: z.string(),
|
||||||
|
tags: z.array(z.object({ icon, label: z.string() })),
|
||||||
|
asideTitle: z.string(),
|
||||||
|
asideBody: z.string(),
|
||||||
|
asideLink: link,
|
||||||
|
eyebrow: z.string(),
|
||||||
|
title: z.string(),
|
||||||
|
lead: z.string(),
|
||||||
|
ctas: z.array(
|
||||||
|
link.extend({ variant: z.enum(['primary', 'secondary', 'link']), icon: icon.optional() }),
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
sections: z.array(
|
||||||
|
z.discriminatedUnion('type', [
|
||||||
|
z.object({
|
||||||
|
type: z.literal('feature'),
|
||||||
|
id: z.string(),
|
||||||
|
eyebrow: z.string(),
|
||||||
|
title: z.string(),
|
||||||
|
body: z.string(),
|
||||||
|
callsign: z.string().optional(),
|
||||||
|
callsignLabel: z.string().optional(),
|
||||||
|
icon,
|
||||||
|
link: link.extend({ href: z.url() }),
|
||||||
|
}),
|
||||||
|
z.object({
|
||||||
|
type: z.literal('cards'),
|
||||||
|
id: z.string(),
|
||||||
|
eyebrow: z.string(),
|
||||||
|
title: z.string(),
|
||||||
|
items: z
|
||||||
|
.array(
|
||||||
|
z.object({
|
||||||
|
title: z.string(),
|
||||||
|
description: z.string().optional(),
|
||||||
|
href: z.url(),
|
||||||
|
icon,
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
.min(1),
|
||||||
|
}),
|
||||||
|
z.object({
|
||||||
|
type: z.literal('latestPosts'),
|
||||||
|
id: z.string(),
|
||||||
|
eyebrow: z.string(),
|
||||||
|
title: z.string(),
|
||||||
|
count: z.number().int().positive(),
|
||||||
|
allLink: link,
|
||||||
|
empty: z.string(),
|
||||||
|
}),
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
});
|
||||||
|
|
||||||
|
const categoriesSchema = z
|
||||||
|
.array(
|
||||||
|
z.object({
|
||||||
|
slug: z.string().regex(/^[a-z0-9-]+$/),
|
||||||
|
name: z.string(),
|
||||||
|
description: z.string(),
|
||||||
|
icon,
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
.min(1);
|
||||||
|
|
||||||
|
/** Object of required string keys; keeps the key names in the inferred type. */
|
||||||
|
const strings = <const K extends string>(keys: readonly K[]) =>
|
||||||
|
z.object(Object.fromEntries(keys.map((k) => [k, z.string()])) as Record<K, z.ZodString>);
|
||||||
|
|
||||||
|
const blogSchema = z.object({
|
||||||
|
seo: z.object({ title: z.string(), description: z.string().max(160) }),
|
||||||
|
list: strings([
|
||||||
|
'eyebrow',
|
||||||
|
'title',
|
||||||
|
'categoryEyebrow',
|
||||||
|
'tagEyebrow',
|
||||||
|
'tagTitle',
|
||||||
|
'categoryDescription',
|
||||||
|
'tagDescription',
|
||||||
|
'pageTitle',
|
||||||
|
'empty',
|
||||||
|
]),
|
||||||
|
card: strings(['readMore', 'readingTime']),
|
||||||
|
dates: strings(['created', 'updated']),
|
||||||
|
pager: strings(['label', 'first', 'prev', 'next', 'last', 'page']),
|
||||||
|
sidebar: strings([
|
||||||
|
'label',
|
||||||
|
'search',
|
||||||
|
'searchLabel',
|
||||||
|
'searchPlaceholder',
|
||||||
|
'searchNoResults',
|
||||||
|
'searchResults',
|
||||||
|
'searchUnavailable',
|
||||||
|
'categories',
|
||||||
|
'featured',
|
||||||
|
'tags',
|
||||||
|
]),
|
||||||
|
post: strings([
|
||||||
|
'breadcrumbLabel',
|
||||||
|
'toc',
|
||||||
|
'shareLabel',
|
||||||
|
'copyLink',
|
||||||
|
'copied',
|
||||||
|
'nativeShare',
|
||||||
|
'copyCode',
|
||||||
|
'codeCopied',
|
||||||
|
'category',
|
||||||
|
'tags',
|
||||||
|
'adjacentLabel',
|
||||||
|
'prev',
|
||||||
|
'next',
|
||||||
|
'license',
|
||||||
|
'licenseName',
|
||||||
|
'licenseHref',
|
||||||
|
]),
|
||||||
|
diy: z.object({ title: z.string(), body: z.string(), link }),
|
||||||
|
share: z.array(
|
||||||
|
z.object({ id: z.string(), label: z.string(), icon, url: z.string().includes('{url}') }),
|
||||||
|
),
|
||||||
|
});
|
||||||
|
|
||||||
|
const seo = z.object({ title: z.string().max(60), description: z.string().max(160) });
|
||||||
|
|
||||||
|
const aboutSchema = z.object({
|
||||||
|
seo,
|
||||||
|
eyebrow: z.string(),
|
||||||
|
title: z.string(),
|
||||||
|
lead: z.string(),
|
||||||
|
identity: z.object({
|
||||||
|
title: z.string(),
|
||||||
|
items: z.array(z.object({ label: z.string(), value: z.string(), icon })),
|
||||||
|
}),
|
||||||
|
equipment: z.array(
|
||||||
|
z.object({
|
||||||
|
title: z.string(),
|
||||||
|
icon,
|
||||||
|
items: z.array(z.object({ name: z.string(), note: z.string().optional() })).min(1),
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
});
|
||||||
|
|
||||||
|
const contactSchema = z.object({
|
||||||
|
seo,
|
||||||
|
eyebrow: z.string(),
|
||||||
|
title: z.string(),
|
||||||
|
icon,
|
||||||
|
lead: z.string(),
|
||||||
|
infoTitle: z.string(),
|
||||||
|
map: z.object({
|
||||||
|
title: z.string(),
|
||||||
|
lat: z.number().min(-90).max(90),
|
||||||
|
lng: z.number().min(-180).max(180),
|
||||||
|
zoom: z.number().int().min(1).max(19),
|
||||||
|
popup: z.string(),
|
||||||
|
ariaLabel: z.string(),
|
||||||
|
note: z.string(),
|
||||||
|
loading: z.string(),
|
||||||
|
}),
|
||||||
|
items: z.array(
|
||||||
|
z.object({
|
||||||
|
label: z.string(),
|
||||||
|
icon,
|
||||||
|
values: z.array(z.string()).optional(),
|
||||||
|
href: z.url().optional(),
|
||||||
|
email: z.email().optional(),
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
});
|
||||||
|
|
||||||
|
const pagesSchema = z.object({
|
||||||
|
legal: strings(['eyebrow', 'updated', 'notice']),
|
||||||
|
notFound: z.object({
|
||||||
|
seoTitle: z.string(),
|
||||||
|
description: z.string(),
|
||||||
|
eyebrow: z.string(),
|
||||||
|
title: z.string(),
|
||||||
|
lead: z.string(),
|
||||||
|
links: z.array(link.extend({ variant: z.enum(['primary', 'secondary', 'link']), icon })),
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
function parse<T>(name: string, schema: z.ZodType<T>, data: unknown): T {
|
||||||
|
const result = schema.safeParse(data);
|
||||||
|
if (!result.success) {
|
||||||
|
throw new Error(`src/data/${name} is invalid:\n${z.prettifyError(result.error)}`);
|
||||||
|
}
|
||||||
|
return result.data;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const site = parse('site.json', siteSchema, siteJson);
|
||||||
|
export const home = parse('home.json', homeSchema, homeJson);
|
||||||
|
export const categories = parse('categories.json', categoriesSchema, categoriesJson);
|
||||||
|
export const blog = parse('blog.json', blogSchema, blogJson);
|
||||||
|
export const about = parse('about.json', aboutSchema, aboutJson);
|
||||||
|
export const contact = parse('contact.json', contactSchema, contactJson);
|
||||||
|
export const pages = parse('pages.json', pagesSchema, pagesJson);
|
||||||
|
export const social = parse('social.json', socialSchema, socialJson).filter((s) => s.href);
|
||||||
|
|
||||||
|
export type Site = z.infer<typeof siteSchema>;
|
||||||
|
export type HomeSection = (typeof home.sections)[number];
|
||||||
|
export type Category = (typeof categories)[number];
|
||||||
|
export type SocialLink = (typeof social)[number];
|
||||||
|
|
||||||
|
/** Fills `{key}` placeholders in UI strings from the JSON files. */
|
||||||
|
export function fmt(template: string, values: Record<string, string | number>): string {
|
||||||
|
return template.replace(/\{(\w+)\}/g, (m, k: string) => (k in values ? String(values[k]) : m));
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
export type DateKind = 'created' | 'updated';
|
||||||
|
export interface DateBadge {
|
||||||
|
kind: DateKind;
|
||||||
|
date: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
const TZ = 'Europe/Istanbul';
|
||||||
|
const dayKey = (d: Date) => new Intl.DateTimeFormat('en-CA', { timeZone: TZ }).format(d);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Which date leads: the newer one is primary (filled badge), the other secondary (outline).
|
||||||
|
* No / same-day / older update → only the created date is shown.
|
||||||
|
*/
|
||||||
|
export function dateBadges(
|
||||||
|
pub: Date,
|
||||||
|
upd?: Date,
|
||||||
|
): { primary: DateBadge; secondary: DateBadge | null } {
|
||||||
|
if (!upd || dayKey(upd) === dayKey(pub) || upd < pub) {
|
||||||
|
return { primary: { kind: 'created', date: pub }, secondary: null };
|
||||||
|
}
|
||||||
|
return { primary: { kind: 'updated', date: upd }, secondary: { kind: 'created', date: pub } };
|
||||||
|
}
|
||||||
|
|
||||||
|
const longFormat = new Intl.DateTimeFormat('tr-TR', {
|
||||||
|
day: 'numeric',
|
||||||
|
month: 'long',
|
||||||
|
year: 'numeric',
|
||||||
|
timeZone: TZ,
|
||||||
|
});
|
||||||
|
|
||||||
|
export const formatDate = (d: Date) => longFormat.format(d);
|
||||||
|
/** Value for `<time datetime>` (calendar day in Istanbul). */
|
||||||
|
export const isoDay = (d: Date) => dayKey(d);
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
// Sätteri (Astro 7 default Markdown processor) HAST plugins.
|
||||||
|
// Plain JS because astro.config.mjs imports it directly.
|
||||||
|
|
||||||
|
const SITE_HOST = 'ta1sph.info';
|
||||||
|
|
||||||
|
const isWhitespace = (n) => n.type === 'text' && !n.value.trim();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* `` alone in a paragraph → `<figure><img><figcaption>Caption</figcaption></figure>`.
|
||||||
|
* Images without a title stay as they are.
|
||||||
|
*/
|
||||||
|
export const figurePlugin = {
|
||||||
|
name: 'ta1sph-figure',
|
||||||
|
element: {
|
||||||
|
filter: ['p'],
|
||||||
|
visit(node, ctx) {
|
||||||
|
const content = node.children.filter((c) => !isWhitespace(c));
|
||||||
|
if (content.length !== 1) return;
|
||||||
|
const img = content[0];
|
||||||
|
if (img.type !== 'element' || img.tagName !== 'img') return;
|
||||||
|
const caption = img.properties?.title;
|
||||||
|
if (typeof caption !== 'string' || !caption.trim()) return;
|
||||||
|
const { title: _title, ...props } = img.properties;
|
||||||
|
ctx.replaceNode(node, {
|
||||||
|
type: 'element',
|
||||||
|
tagName: 'figure',
|
||||||
|
properties: {},
|
||||||
|
children: [
|
||||||
|
{ ...img, properties: props },
|
||||||
|
{
|
||||||
|
type: 'element',
|
||||||
|
tagName: 'figcaption',
|
||||||
|
properties: {},
|
||||||
|
children: [{ type: 'text', value: caption }],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Absolute links to other sites open in a new tab with a safe rel. */
|
||||||
|
export const externalLinksPlugin = {
|
||||||
|
name: 'ta1sph-external-links',
|
||||||
|
element: {
|
||||||
|
filter: ['a'],
|
||||||
|
visit(node, ctx) {
|
||||||
|
const href = node.properties?.href;
|
||||||
|
if (typeof href !== 'string' || !/^https?:\/\//i.test(href)) return;
|
||||||
|
try {
|
||||||
|
const host = new URL(href).hostname.replace(/^www\./, '');
|
||||||
|
if (host === SITE_HOST) return;
|
||||||
|
} catch {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ctx.setProperty(node, 'target', '_blank');
|
||||||
|
ctx.setProperty(node, 'rel', ['noopener', 'noreferrer']);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
@@ -0,0 +1,164 @@
|
|||||||
|
/**
|
||||||
|
* Build-time Open Graph images (1200×630 PNG) with Satori + Sharp.
|
||||||
|
* Used by the prerendered /og/<slug>.png and /og-default.png endpoints.
|
||||||
|
*/
|
||||||
|
import { readFileSync } from 'node:fs';
|
||||||
|
import { createRequire } from 'node:module';
|
||||||
|
import satori from 'satori';
|
||||||
|
import sharp from 'sharp';
|
||||||
|
import { site } from './data';
|
||||||
|
|
||||||
|
const require = createRequire(import.meta.url);
|
||||||
|
const font = (pkg: string, file: string) => readFileSync(require.resolve(`${pkg}/files/${file}`));
|
||||||
|
|
||||||
|
// Satori needs woff/ttf (not woff2). latin-ext (İ, Ş, Ğ…) gets its own family name and is
|
||||||
|
// listed as a fallback in fontFamily; same-name entries are not used as glyph fallbacks.
|
||||||
|
const fonts = [
|
||||||
|
{
|
||||||
|
name: 'Rubik',
|
||||||
|
weight: 900 as const,
|
||||||
|
data: font('@fontsource/rubik', 'rubik-latin-900-normal.woff'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'RubikExt',
|
||||||
|
weight: 900 as const,
|
||||||
|
data: font('@fontsource/rubik', 'rubik-latin-ext-900-normal.woff'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Rubik',
|
||||||
|
weight: 700 as const,
|
||||||
|
data: font('@fontsource/rubik', 'rubik-latin-700-normal.woff'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'RubikExt',
|
||||||
|
weight: 700 as const,
|
||||||
|
data: font('@fontsource/rubik', 'rubik-latin-ext-700-normal.woff'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Inter',
|
||||||
|
weight: 600 as const,
|
||||||
|
data: font('@fontsource/inter', 'inter-latin-600-normal.woff'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'InterExt',
|
||||||
|
weight: 600 as const,
|
||||||
|
data: font('@fontsource/inter', 'inter-latin-ext-600-normal.woff'),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
// Image-only palette (Huemint Magazine); theme tokens are CSS-only.
|
||||||
|
const C = {
|
||||||
|
paper: '#f2efee',
|
||||||
|
khaki: '#d5d09b',
|
||||||
|
ink: '#111012',
|
||||||
|
red: '#c95748',
|
||||||
|
line: 'rgba(17,16,18,0.18)',
|
||||||
|
};
|
||||||
|
|
||||||
|
function towerIcon(color: string): string {
|
||||||
|
const { icons, width = 24, height = 24 } = require('@iconify-json/tabler/icons.json');
|
||||||
|
const body: string = icons['building-broadcast-tower'].body.replaceAll('currentColor', color);
|
||||||
|
const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${width} ${height}">${body}</svg>`;
|
||||||
|
return `data:image/svg+xml;base64,${Buffer.from(svg).toString('base64')}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
type Node = { type: string; props: Record<string, unknown> & { children?: unknown } };
|
||||||
|
const h = (type: string, style: Record<string, unknown>, children?: unknown, extra = {}): Node => ({
|
||||||
|
type,
|
||||||
|
props: { style, children, ...extra },
|
||||||
|
});
|
||||||
|
|
||||||
|
export interface OgInput {
|
||||||
|
title: string;
|
||||||
|
eyebrow?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function renderOg({ title, eyebrow }: OgInput): Promise<Buffer> {
|
||||||
|
const upper = title.toLocaleUpperCase('tr-TR');
|
||||||
|
const size = upper.length <= 28 ? 96 : upper.length <= 48 ? 78 : 62;
|
||||||
|
|
||||||
|
const tree = h(
|
||||||
|
'div',
|
||||||
|
{
|
||||||
|
width: 1200,
|
||||||
|
height: 630,
|
||||||
|
display: 'flex',
|
||||||
|
flexDirection: 'column',
|
||||||
|
position: 'relative',
|
||||||
|
backgroundColor: C.khaki,
|
||||||
|
color: C.ink,
|
||||||
|
fontFamily: 'Rubik, RubikExt',
|
||||||
|
},
|
||||||
|
[
|
||||||
|
// Magazine grid lines
|
||||||
|
...[140, 380, 700, 1000].map((x) =>
|
||||||
|
h('div', {
|
||||||
|
position: 'absolute',
|
||||||
|
top: 0,
|
||||||
|
bottom: 0,
|
||||||
|
left: x,
|
||||||
|
width: 2,
|
||||||
|
backgroundColor: C.line,
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
h(
|
||||||
|
'div',
|
||||||
|
{ display: 'flex', flexDirection: 'column', flex: 1, padding: '56px 72px 40px 72px' },
|
||||||
|
[
|
||||||
|
h('div', { display: 'flex', alignItems: 'center', justifyContent: 'space-between' }, [
|
||||||
|
h('div', { display: 'flex', alignItems: 'center', gap: 16 }, [
|
||||||
|
h('img', { width: 56, height: 56 }, undefined, {
|
||||||
|
src: towerIcon(C.ink),
|
||||||
|
width: 56,
|
||||||
|
height: 56,
|
||||||
|
}),
|
||||||
|
h('div', { fontSize: 44, fontWeight: 900, letterSpacing: -1 }, site.author.callsign),
|
||||||
|
]),
|
||||||
|
eyebrow
|
||||||
|
? h('div', { display: 'flex', alignItems: 'center', gap: 16 }, [
|
||||||
|
h(
|
||||||
|
'div',
|
||||||
|
{ fontSize: 26, fontWeight: 700, letterSpacing: 1 },
|
||||||
|
eyebrow.toLocaleUpperCase('tr-TR'),
|
||||||
|
),
|
||||||
|
h('div', { width: 64, height: 4, backgroundColor: C.red }),
|
||||||
|
])
|
||||||
|
: h('div', {}, ''),
|
||||||
|
]),
|
||||||
|
h('div', { display: 'flex', flex: 1, alignItems: 'center' }, [
|
||||||
|
h(
|
||||||
|
'div',
|
||||||
|
{
|
||||||
|
fontSize: size,
|
||||||
|
fontWeight: 900,
|
||||||
|
lineHeight: 0.98,
|
||||||
|
letterSpacing: -2,
|
||||||
|
maxWidth: 1040,
|
||||||
|
},
|
||||||
|
upper,
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
h(
|
||||||
|
'div',
|
||||||
|
{
|
||||||
|
display: 'flex',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
fontFamily: 'Inter, InterExt',
|
||||||
|
fontWeight: 600,
|
||||||
|
fontSize: 26,
|
||||||
|
},
|
||||||
|
[h('div', {}, new URL(site.url).host), h('div', {}, `${site.author.locator} · 73`)],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
h('div', { height: 16, backgroundColor: C.red }),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
|
||||||
|
const svg = await satori(tree as Parameters<typeof satori>[0], {
|
||||||
|
width: 1200,
|
||||||
|
height: 630,
|
||||||
|
fonts,
|
||||||
|
});
|
||||||
|
return sharp(Buffer.from(svg)).png({ compressionLevel: 9 }).toBuffer();
|
||||||
|
}
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
import { getCollection, type CollectionEntry } from 'astro:content';
|
||||||
|
import { categories, type Category } from './data';
|
||||||
|
import { slugify } from './slug';
|
||||||
|
|
||||||
|
export type Post = CollectionEntry<'blog'>;
|
||||||
|
|
||||||
|
/** Published posts (drafts only in dev), newest `pubDate` first. Unknown categories fail the build. */
|
||||||
|
export async function getPosts(): Promise<Post[]> {
|
||||||
|
const posts = await getCollection('blog', ({ data }) => import.meta.env.DEV || !data.draft);
|
||||||
|
for (const post of posts) {
|
||||||
|
if (!categories.some((c) => c.slug === post.data.category)) {
|
||||||
|
throw new Error(
|
||||||
|
`Post "${post.id}" uses unknown category "${post.data.category}" (see src/data/categories.json)`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return posts.sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf());
|
||||||
|
}
|
||||||
|
|
||||||
|
export const postUrl = (post: Post) => `/blog/${post.id}/`;
|
||||||
|
export const categoryUrl = (slug: string) => `/blog/kategori/${slug}/`;
|
||||||
|
export const tagUrl = (tag: string) => `/blog/etiket/${slugify(tag)}/`;
|
||||||
|
export const tagSlug = (tag: string) => slugify(tag);
|
||||||
|
|
||||||
|
export function categoryOf(post: Post): Category {
|
||||||
|
return categories.find((c) => c.slug === post.data.category)!;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** ~200 words per minute on the raw Markdown body (code blocks included). */
|
||||||
|
export function readingMinutes(post: Post): number {
|
||||||
|
const words = (post.body ?? '').split(/\s+/).filter(Boolean).length;
|
||||||
|
return Math.max(1, Math.round(words / 200));
|
||||||
|
}
|
||||||
|
|
||||||
|
export function categoryCounts(posts: Post[]) {
|
||||||
|
return categories
|
||||||
|
.map((category) => ({
|
||||||
|
category,
|
||||||
|
count: posts.filter((p) => p.data.category === category.slug).length,
|
||||||
|
}))
|
||||||
|
.filter((c) => c.count > 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TagCount {
|
||||||
|
tag: string;
|
||||||
|
slug: string;
|
||||||
|
count: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Tags grouped by slug (first spelling wins), most used first. */
|
||||||
|
export function tagCounts(posts: Post[]): TagCount[] {
|
||||||
|
const map = new Map<string, TagCount>();
|
||||||
|
for (const tag of posts.flatMap((p) => p.data.tags)) {
|
||||||
|
const slug = slugify(tag);
|
||||||
|
const entry = map.get(slug) ?? { tag, slug, count: 0 };
|
||||||
|
entry.count++;
|
||||||
|
map.set(slug, entry);
|
||||||
|
}
|
||||||
|
return [...map.values()].sort((a, b) => b.count - a.count || a.tag.localeCompare(b.tag, 'tr'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Fallback "featured" list: frontmatter `featured` first, topped up with the latest posts. */
|
||||||
|
export function featuredPosts(posts: Post[], limit = 3): Post[] {
|
||||||
|
const featured = posts.filter((p) => p.data.featured);
|
||||||
|
return [...featured, ...posts.filter((p) => !p.data.featured)].slice(0, limit);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** prev = older post, next = newer post. */
|
||||||
|
export function adjacentPosts(posts: Post[], post: Post) {
|
||||||
|
const i = posts.findIndex((p) => p.id === post.id);
|
||||||
|
return { prev: posts[i + 1], next: i > 0 ? posts[i - 1] : undefined };
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Chunks a list into pages; always at least one (possibly empty) page. */
|
||||||
|
export function chunk<T>(items: T[], size: number): T[][] {
|
||||||
|
const pages: T[][] = [];
|
||||||
|
for (let i = 0; i < items.length; i += size) pages.push(items.slice(i, i + size));
|
||||||
|
return pages.length ? pages : [[]];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Page 1 lives at the base URL, others at `<base>sayfa/<n>/`. */
|
||||||
|
export const pageUrl = (base: string, n: number) => (n <= 1 ? base : `${base}sayfa/${n}/`);
|
||||||
|
|
||||||
|
/** `[...page]` param value for page n (undefined = page 1). */
|
||||||
|
export const pageParam = (n: number) => (n <= 1 ? undefined : `sayfa/${n}`);
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
const TR_MAP: Record<string, string> = {
|
||||||
|
ç: 'c',
|
||||||
|
ğ: 'g',
|
||||||
|
ı: 'i',
|
||||||
|
İ: 'i',
|
||||||
|
ö: 'o',
|
||||||
|
ş: 's',
|
||||||
|
ü: 'u',
|
||||||
|
Ç: 'c',
|
||||||
|
Ğ: 'g',
|
||||||
|
Ö: 'o',
|
||||||
|
Ş: 's',
|
||||||
|
Ü: 'u',
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Turkish-aware slugify: "Çift Bant Anten" → "cift-bant-anten". */
|
||||||
|
export function slugify(input: string): string {
|
||||||
|
return input
|
||||||
|
.replace(/[çğıİöşüÇĞÖŞÜ]/g, (ch) => TR_MAP[ch] ?? ch)
|
||||||
|
.normalize('NFKD')
|
||||||
|
.replace(/[̀-ͯ]/g, '')
|
||||||
|
.toLowerCase()
|
||||||
|
.replace(/[^a-z0-9]+/g, '-')
|
||||||
|
.replace(/^-+|-+$/g, '');
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
/**
|
||||||
|
* Anonymous view counter on node:sqlite (server-only; used by /api/views/*).
|
||||||
|
* Privacy: the IP is never stored. Each hit stores sha256(daySalt + ip + slug) for 24 h only,
|
||||||
|
* the salt is random per UTC day and old salts are deleted, so hashes cannot be linked later.
|
||||||
|
*/
|
||||||
|
import { createHash, randomBytes } from 'node:crypto';
|
||||||
|
import { mkdirSync } from 'node:fs';
|
||||||
|
import { join } from 'node:path';
|
||||||
|
import { DatabaseSync } from 'node:sqlite';
|
||||||
|
|
||||||
|
const DAY_MS = 24 * 60 * 60 * 1000;
|
||||||
|
let db: DatabaseSync | undefined;
|
||||||
|
|
||||||
|
function open(): DatabaseSync {
|
||||||
|
if (db) return db;
|
||||||
|
const dir = process.env.DATA_DIR ?? './data';
|
||||||
|
mkdirSync(dir, { recursive: true });
|
||||||
|
db = new DatabaseSync(join(dir, 'views.db'));
|
||||||
|
db.exec(`
|
||||||
|
PRAGMA journal_mode = WAL;
|
||||||
|
CREATE TABLE IF NOT EXISTS views (slug TEXT PRIMARY KEY, count INTEGER NOT NULL DEFAULT 0);
|
||||||
|
CREATE TABLE IF NOT EXISTS hits (hash TEXT PRIMARY KEY, at INTEGER NOT NULL);
|
||||||
|
CREATE TABLE IF NOT EXISTS salts (day TEXT PRIMARY KEY, salt TEXT NOT NULL);
|
||||||
|
`);
|
||||||
|
return db;
|
||||||
|
}
|
||||||
|
|
||||||
|
function daySalt(d: DatabaseSync, now: number): string {
|
||||||
|
const day = new Date(now).toISOString().slice(0, 10);
|
||||||
|
const row = d.prepare('SELECT salt FROM salts WHERE day = ?').get(day) as
|
||||||
|
{ salt: string } | undefined;
|
||||||
|
if (row) return row.salt;
|
||||||
|
const salt = randomBytes(32).toString('hex');
|
||||||
|
d.prepare('INSERT OR IGNORE INTO salts (day, salt) VALUES (?, ?)').run(day, salt);
|
||||||
|
d.prepare('DELETE FROM salts WHERE day <> ?').run(day);
|
||||||
|
return (d.prepare('SELECT salt FROM salts WHERE day = ?').get(day) as { salt: string }).salt;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Counts a view unless the same visitor viewed this slug in the last 24 h. Returns true if counted. */
|
||||||
|
export function recordView(slug: string, ip: string, now = Date.now()): boolean {
|
||||||
|
const d = open();
|
||||||
|
const hash = createHash('sha256')
|
||||||
|
.update(`${daySalt(d, now)}|${ip}|${slug}`)
|
||||||
|
.digest('hex');
|
||||||
|
d.prepare('DELETE FROM hits WHERE at < ?').run(now - DAY_MS);
|
||||||
|
const fresh = d.prepare('INSERT OR IGNORE INTO hits (hash, at) VALUES (?, ?)').run(hash, now);
|
||||||
|
if (fresh.changes === 0) return false;
|
||||||
|
d.prepare(
|
||||||
|
'INSERT INTO views (slug, count) VALUES (?, 1) ON CONFLICT(slug) DO UPDATE SET count = count + 1',
|
||||||
|
).run(slug);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function topViews(limit: number): { slug: string; count: number }[] {
|
||||||
|
return open()
|
||||||
|
.prepare('SELECT slug, count FROM views WHERE count > 0 ORDER BY count DESC, slug LIMIT ?')
|
||||||
|
.all(limit) as { slug: string; count: number }[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** First X-Forwarded-For hop (Traefik/Dokploy), else the socket address. */
|
||||||
|
export function clientIp(request: Request, fallback: string): string {
|
||||||
|
return request.headers.get('x-forwarded-for')?.split(',')[0]?.trim() || fallback;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const isBot = (ua: string | null) =>
|
||||||
|
!ua || /bot|crawl|spider|slurp|preview|facebookexternalhit|headless|lighthouse/i.test(ua);
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
---
|
||||||
|
import Button from '../components/Button.astro';
|
||||||
|
import Container from '../components/Container.astro';
|
||||||
|
import GridLines from '../components/GridLines.astro';
|
||||||
|
import SectionHeading from '../components/SectionHeading.astro';
|
||||||
|
import Numeral from '../components/home/Numeral.astro';
|
||||||
|
import BaseLayout from '../layouts/BaseLayout.astro';
|
||||||
|
import { pages } from '../lib/data';
|
||||||
|
|
||||||
|
const t = pages.notFound;
|
||||||
|
---
|
||||||
|
|
||||||
|
<BaseLayout title={t.seoTitle} description={t.description} noindex>
|
||||||
|
<section class="surface-alt relative min-h-[60vh] overflow-hidden">
|
||||||
|
<GridLines />
|
||||||
|
<Container class="relative grid gap-8 py-20 md:grid-cols-[1.4fr_1.6fr_4.2fr] md:gap-0 md:py-28">
|
||||||
|
<Numeral value="404" alt class="text-[clamp(4rem,9vw,8rem)] md:col-span-2" />
|
||||||
|
<div class="flex flex-col gap-6 md:pl-8">
|
||||||
|
<SectionHeading level={1} eyebrow={t.eyebrow} title={t.title} />
|
||||||
|
<p class="max-w-xl text-lg">{t.lead}</p>
|
||||||
|
<div class="flex flex-wrap gap-4">
|
||||||
|
{t.links.map((l) => (
|
||||||
|
<Button href={l.href} variant={l.variant} icon={l.icon}>
|
||||||
|
{l.label}
|
||||||
|
</Button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Container>
|
||||||
|
</section>
|
||||||
|
</BaseLayout>
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
---
|
||||||
|
// /gizlilik/, /lisans/, /sorumluluk-reddi/ from src/content/legal/*.md
|
||||||
|
import type { GetStaticPaths } from 'astro';
|
||||||
|
import { getCollection, render } from 'astro:content';
|
||||||
|
import CodeCopy from '../components/CodeCopy.astro';
|
||||||
|
import Container from '../components/Container.astro';
|
||||||
|
import PageHeader from '../components/PageHeader.astro';
|
||||||
|
import BaseLayout from '../layouts/BaseLayout.astro';
|
||||||
|
import { pages } from '../lib/data';
|
||||||
|
import { formatDate, isoDay } from '../lib/dates';
|
||||||
|
|
||||||
|
export const getStaticPaths = (async () => {
|
||||||
|
const docs = await getCollection('legal');
|
||||||
|
return docs.map((doc) => ({ params: { legal: doc.id }, props: { doc } }));
|
||||||
|
}) satisfies GetStaticPaths;
|
||||||
|
|
||||||
|
const { doc } = Astro.props;
|
||||||
|
const { Content } = await render(doc);
|
||||||
|
---
|
||||||
|
|
||||||
|
<BaseLayout title={doc.data.title} description={doc.data.description}>
|
||||||
|
<PageHeader eyebrow={pages.legal.eyebrow} title={doc.data.title}>
|
||||||
|
<p class="text-sm font-semibold">
|
||||||
|
{pages.legal.updated}:{' '}
|
||||||
|
<time datetime={isoDay(doc.data.updated)}>{formatDate(doc.data.updated)}</time>
|
||||||
|
</p>
|
||||||
|
</PageHeader>
|
||||||
|
<Container class="max-w-[52rem] py-14 md:py-20">
|
||||||
|
<div class="prose article-prose md:prose-lg max-w-[72ch]">
|
||||||
|
<CodeCopy>
|
||||||
|
<Content />
|
||||||
|
</CodeCopy>
|
||||||
|
</div>
|
||||||
|
<p class="border-line text-fg-muted mt-12 border-t pt-6 text-sm">{pages.legal.notice}</p>
|
||||||
|
</Container>
|
||||||
|
</BaseLayout>
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import type { APIRoute } from 'astro';
|
||||||
|
import { getPosts } from '../../../lib/posts';
|
||||||
|
import { clientIp, isBot, recordView } from '../../../lib/views';
|
||||||
|
|
||||||
|
export const prerender = false;
|
||||||
|
|
||||||
|
// POST /api/views/<slug>/ — counts one view (sent with navigator.sendBeacon).
|
||||||
|
export const POST: APIRoute = async ({ params, request, clientAddress }) => {
|
||||||
|
const slug = params.slug ?? '';
|
||||||
|
const posts = await getPosts();
|
||||||
|
if (!posts.some((p) => p.id === slug)) return new Response(null, { status: 404 });
|
||||||
|
if (!isBot(request.headers.get('user-agent'))) {
|
||||||
|
recordView(slug, clientIp(request, clientAddress));
|
||||||
|
}
|
||||||
|
return new Response(null, { status: 204, headers: { 'Cache-Control': 'no-store' } });
|
||||||
|
};
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import type { APIRoute } from 'astro';
|
||||||
|
import { getPosts, postUrl } from '../../../lib/posts';
|
||||||
|
import { topViews } from '../../../lib/views';
|
||||||
|
|
||||||
|
export const prerender = false;
|
||||||
|
|
||||||
|
// GET /api/views/top/?limit=3 — most viewed published posts.
|
||||||
|
export const GET: APIRoute = async ({ url }) => {
|
||||||
|
const limit = Math.min(10, Math.max(1, Number(url.searchParams.get('limit')) || 3));
|
||||||
|
const posts = new Map((await getPosts()).map((p) => [p.id, p]));
|
||||||
|
const items = topViews(limit * 2) // headroom for deleted/draft slugs
|
||||||
|
.filter((v) => posts.has(v.slug))
|
||||||
|
.slice(0, limit)
|
||||||
|
.map((v) => {
|
||||||
|
const post = posts.get(v.slug)!;
|
||||||
|
return { slug: v.slug, title: post.data.title, url: postUrl(post), count: v.count };
|
||||||
|
});
|
||||||
|
return Response.json(items, { headers: { 'Cache-Control': 'public, max-age=300' } });
|
||||||
|
};
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
---
|
||||||
|
// /blog/ and /blog/sayfa/<n>/
|
||||||
|
import type { GetStaticPaths } from 'astro';
|
||||||
|
import BlogListing from '../../components/blog/BlogListing.astro';
|
||||||
|
import { blog, site } from '../../lib/data';
|
||||||
|
import { chunk, getPosts, pageParam } from '../../lib/posts';
|
||||||
|
|
||||||
|
export const getStaticPaths = (async () => {
|
||||||
|
const posts = await getPosts();
|
||||||
|
const pages = chunk(posts, site.postsPerPage);
|
||||||
|
return pages.map((items, i) => ({
|
||||||
|
params: { page: pageParam(i + 1) },
|
||||||
|
props: { items, allPosts: posts, current: i + 1, total: pages.length },
|
||||||
|
}));
|
||||||
|
}) satisfies GetStaticPaths;
|
||||||
|
|
||||||
|
const { items, allPosts, current, total } = Astro.props;
|
||||||
|
---
|
||||||
|
|
||||||
|
<BlogListing
|
||||||
|
eyebrow={blog.list.eyebrow}
|
||||||
|
title={blog.list.title}
|
||||||
|
description={blog.seo.description}
|
||||||
|
posts={items}
|
||||||
|
allPosts={allPosts}
|
||||||
|
current={current}
|
||||||
|
total={total}
|
||||||
|
base="/blog/"
|
||||||
|
/>
|
||||||
@@ -0,0 +1,223 @@
|
|||||||
|
---
|
||||||
|
import type { GetStaticPaths } from 'astro';
|
||||||
|
import { getImage, Image } from 'astro:assets';
|
||||||
|
import { render } from 'astro:content';
|
||||||
|
import { Icon } from 'astro-icon/components';
|
||||||
|
import Badge from '../../components/Badge.astro';
|
||||||
|
import Breadcrumbs from '../../components/blog/Breadcrumbs.astro';
|
||||||
|
import DateBadges from '../../components/blog/DateBadges.astro';
|
||||||
|
import DiyNotice from '../../components/blog/DiyNotice.astro';
|
||||||
|
import ShareBar from '../../components/blog/ShareBar.astro';
|
||||||
|
import Toc from '../../components/blog/Toc.astro';
|
||||||
|
import CodeCopy from '../../components/CodeCopy.astro';
|
||||||
|
import Container from '../../components/Container.astro';
|
||||||
|
import BaseLayout from '../../layouts/BaseLayout.astro';
|
||||||
|
import { blog, site } from '../../lib/data';
|
||||||
|
import {
|
||||||
|
adjacentPosts,
|
||||||
|
categoryOf,
|
||||||
|
categoryUrl,
|
||||||
|
getPosts,
|
||||||
|
postUrl,
|
||||||
|
readingMinutes,
|
||||||
|
tagUrl,
|
||||||
|
} from '../../lib/posts';
|
||||||
|
|
||||||
|
export const getStaticPaths = (async () => {
|
||||||
|
const posts = await getPosts();
|
||||||
|
return posts.map((post) => ({
|
||||||
|
params: { slug: post.id },
|
||||||
|
props: { post, ...adjacentPosts(posts, post) },
|
||||||
|
}));
|
||||||
|
}) satisfies GetStaticPaths;
|
||||||
|
|
||||||
|
const { post, prev, next } = Astro.props;
|
||||||
|
const { title, description, pubDate, updatedDate, cover, coverAlt, tags, diy } = post.data;
|
||||||
|
const { Content, headings } = await render(post);
|
||||||
|
const category = categoryOf(post);
|
||||||
|
const url = new URL(postUrl(post), site.url).href;
|
||||||
|
|
||||||
|
// Share image: 1200px JPEG of the cover, else the generated /og/<slug>.png card.
|
||||||
|
const coverOg = cover ? await getImage({ src: cover, width: 1200, format: 'jpeg' }) : undefined;
|
||||||
|
const ogImage = coverOg?.src ?? `/og/${post.id}.png`;
|
||||||
|
const [ogWidth, ogHeight] = coverOg
|
||||||
|
? [Number(coverOg.attributes.width), Number(coverOg.attributes.height)]
|
||||||
|
: [1200, 630];
|
||||||
|
|
||||||
|
const crumbs = [
|
||||||
|
{ label: site.ui.home, href: '/' },
|
||||||
|
{ label: blog.seo.title, href: '/blog/' },
|
||||||
|
{ label: category.name, href: categoryUrl(category.slug) },
|
||||||
|
{ label: title },
|
||||||
|
];
|
||||||
|
|
||||||
|
const jsonLd = [
|
||||||
|
{
|
||||||
|
'@type': 'BlogPosting',
|
||||||
|
'@id': `${url}#article`,
|
||||||
|
headline: title,
|
||||||
|
description,
|
||||||
|
url,
|
||||||
|
mainEntityOfPage: url,
|
||||||
|
inLanguage: site.lang,
|
||||||
|
datePublished: pubDate.toISOString(),
|
||||||
|
dateModified: (updatedDate ?? pubDate).toISOString(),
|
||||||
|
author: { '@id': `${site.url}/#person` },
|
||||||
|
publisher: { '@id': `${site.url}/#person` },
|
||||||
|
articleSection: category.name,
|
||||||
|
keywords: tags.join(', '),
|
||||||
|
image: new URL(ogImage, site.url).href,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'@type': 'BreadcrumbList',
|
||||||
|
itemListElement: crumbs.map((c, i) => ({
|
||||||
|
'@type': 'ListItem',
|
||||||
|
position: i + 1,
|
||||||
|
name: c.label,
|
||||||
|
item: new URL(c.href ?? postUrl(post), site.url).href,
|
||||||
|
})),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
---
|
||||||
|
|
||||||
|
<BaseLayout
|
||||||
|
title={title}
|
||||||
|
description={description}
|
||||||
|
type="article"
|
||||||
|
image={ogImage}
|
||||||
|
imageAlt={coverAlt ?? title}
|
||||||
|
imageWidth={ogWidth}
|
||||||
|
imageHeight={ogHeight}
|
||||||
|
publishedTime={pubDate}
|
||||||
|
modifiedTime={updatedDate}
|
||||||
|
jsonLd={jsonLd}
|
||||||
|
>
|
||||||
|
<Container class="max-w-[52rem] py-10 md:py-14">
|
||||||
|
<article data-pagefind-body class="flex flex-col gap-8">
|
||||||
|
<header class="flex flex-col gap-5">
|
||||||
|
<Breadcrumbs items={crumbs} />
|
||||||
|
<h1 class="headline text-[clamp(2rem,5vw,3.5rem)]" data-pagefind-meta="title">
|
||||||
|
{title}
|
||||||
|
</h1>
|
||||||
|
<p class="text-fg-muted text-lg">{description}</p>
|
||||||
|
<DateBadges pubDate={pubDate} updatedDate={updatedDate} minutes={readingMinutes(post)} />
|
||||||
|
</header>
|
||||||
|
|
||||||
|
{cover && (
|
||||||
|
<Image
|
||||||
|
src={cover}
|
||||||
|
alt={coverAlt ?? ''}
|
||||||
|
widths={[640, 960, 1280]}
|
||||||
|
sizes="(min-width: 832px) 800px, 100vw"
|
||||||
|
loading="eager"
|
||||||
|
fetchpriority="high"
|
||||||
|
class="border-line w-full border"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<div data-pagefind-ignore>
|
||||||
|
<ShareBar url={url} title={title} />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{diy && <DiyNotice />}
|
||||||
|
<div data-pagefind-ignore>
|
||||||
|
<Toc headings={headings} />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="prose article-prose md:prose-lg max-w-[72ch]" data-view-slug={post.id}>
|
||||||
|
<CodeCopy>
|
||||||
|
<Content />
|
||||||
|
</CodeCopy>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<footer data-pagefind-ignore class="border-line flex flex-col gap-6 border-t pt-8">
|
||||||
|
<dl class="flex flex-col gap-4">
|
||||||
|
<div class="flex flex-wrap items-center gap-3">
|
||||||
|
<dt class="font-display text-sm font-bold tracking-wide uppercase">
|
||||||
|
{blog.post.category}
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
<Badge variant="category" href={categoryUrl(category.slug)} icon={category.icon}>
|
||||||
|
{category.name}
|
||||||
|
</Badge>
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
{tags.length > 0 && (
|
||||||
|
<div class="flex flex-wrap items-baseline gap-3">
|
||||||
|
<dt class="font-display text-sm font-bold tracking-wide uppercase">
|
||||||
|
{blog.post.tags}
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
<ul class="flex flex-wrap gap-2">
|
||||||
|
{tags.map((t) => (
|
||||||
|
<li>
|
||||||
|
<Badge variant="outline" href={tagUrl(t)} icon="tabler:tag">
|
||||||
|
{t}
|
||||||
|
</Badge>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</dl>
|
||||||
|
<p class="text-fg-muted flex items-start gap-2 text-sm">
|
||||||
|
<span class="flex shrink-0 gap-0.5" aria-hidden="true">
|
||||||
|
<Icon name="tabler:creative-commons" class="size-5" />
|
||||||
|
<Icon name="tabler:creative-commons-by" class="size-5" />
|
||||||
|
<Icon name="tabler:creative-commons-sa" class="size-5" />
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
{blog.post.license.split('{license}')[0]}
|
||||||
|
<a
|
||||||
|
href={blog.post.licenseHref}
|
||||||
|
class="text-fg font-semibold underline underline-offset-4"
|
||||||
|
>
|
||||||
|
{blog.post.licenseName}
|
||||||
|
</a>
|
||||||
|
{blog.post.license.split('{license}')[1]}
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
</footer>
|
||||||
|
</article>
|
||||||
|
|
||||||
|
{(prev || next) && (
|
||||||
|
<nav aria-label={blog.post.adjacentLabel} class="mt-12 grid gap-4 sm:grid-cols-2">
|
||||||
|
{prev ? (
|
||||||
|
<a
|
||||||
|
href={postUrl(prev)}
|
||||||
|
class="border-line hover:border-fg flex flex-col gap-1 border p-5"
|
||||||
|
>
|
||||||
|
<span class="font-display text-accent-text inline-flex items-center gap-1 text-sm font-bold uppercase">
|
||||||
|
<Icon name="tabler:arrow-left" class="size-4" aria-hidden="true" />
|
||||||
|
{blog.post.prev}
|
||||||
|
</span>
|
||||||
|
<span class="font-semibold">{prev.data.title}</span>
|
||||||
|
</a>
|
||||||
|
) : (
|
||||||
|
<span />
|
||||||
|
)}
|
||||||
|
{next && (
|
||||||
|
<a
|
||||||
|
href={postUrl(next)}
|
||||||
|
class="border-line hover:border-fg flex flex-col items-end gap-1 border p-5 text-right"
|
||||||
|
>
|
||||||
|
<span class="font-display text-accent-text inline-flex items-center gap-1 text-sm font-bold uppercase">
|
||||||
|
{blog.post.next}
|
||||||
|
<Icon name="tabler:arrow-right" class="size-4" aria-hidden="true" />
|
||||||
|
</span>
|
||||||
|
<span class="font-semibold">{next.data.title}</span>
|
||||||
|
</a>
|
||||||
|
)}
|
||||||
|
</nav>
|
||||||
|
)}
|
||||||
|
</Container>
|
||||||
|
</BaseLayout>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Count one view (anonymous, server dedupes per visitor for 24 h).
|
||||||
|
const viewed = document.querySelector<HTMLElement>('[data-view-slug]')?.dataset.viewSlug;
|
||||||
|
if (viewed && 'sendBeacon' in navigator) {
|
||||||
|
navigator.sendBeacon(`/api/views/${encodeURIComponent(viewed)}/`);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
---
|
||||||
|
// /blog/etiket/<tag>/ and …/sayfa/<n>/
|
||||||
|
import type { GetStaticPaths } from 'astro';
|
||||||
|
import BlogListing from '../../../../components/blog/BlogListing.astro';
|
||||||
|
import { blog, fmt, site } from '../../../../lib/data';
|
||||||
|
import { chunk, getPosts, pageParam, tagCounts, tagSlug, tagUrl } from '../../../../lib/posts';
|
||||||
|
|
||||||
|
export const getStaticPaths = (async () => {
|
||||||
|
const posts = await getPosts();
|
||||||
|
return tagCounts(posts).flatMap((t) => {
|
||||||
|
const tagged = posts.filter((p) => p.data.tags.some((x) => tagSlug(x) === t.slug));
|
||||||
|
const pages = chunk(tagged, site.postsPerPage);
|
||||||
|
return pages.map((items, i) => ({
|
||||||
|
params: { tag: t.slug, page: pageParam(i + 1) },
|
||||||
|
props: {
|
||||||
|
tag: t.tag,
|
||||||
|
slug: t.slug,
|
||||||
|
items,
|
||||||
|
allPosts: posts,
|
||||||
|
current: i + 1,
|
||||||
|
total: pages.length,
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
}) satisfies GetStaticPaths;
|
||||||
|
|
||||||
|
const { tag, slug, items, allPosts, current, total } = Astro.props;
|
||||||
|
---
|
||||||
|
|
||||||
|
<BlogListing
|
||||||
|
eyebrow={blog.list.tagEyebrow}
|
||||||
|
title={fmt(blog.list.tagTitle, { tag })}
|
||||||
|
description={fmt(blog.list.tagDescription, { tag })}
|
||||||
|
posts={items}
|
||||||
|
allPosts={allPosts}
|
||||||
|
current={current}
|
||||||
|
total={total}
|
||||||
|
base={tagUrl(tag)}
|
||||||
|
activeTag={slug}
|
||||||
|
/>
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
---
|
||||||
|
// /blog/kategori/<category>/ and …/sayfa/<n>/
|
||||||
|
import type { GetStaticPaths } from 'astro';
|
||||||
|
import BlogListing from '../../../../components/blog/BlogListing.astro';
|
||||||
|
import { blog, categories, fmt, site } from '../../../../lib/data';
|
||||||
|
import { categoryUrl, chunk, getPosts, pageParam } from '../../../../lib/posts';
|
||||||
|
|
||||||
|
export const getStaticPaths = (async () => {
|
||||||
|
const posts = await getPosts();
|
||||||
|
return categories.flatMap((category) => {
|
||||||
|
const inCategory = posts.filter((p) => p.data.category === category.slug);
|
||||||
|
if (!inCategory.length) return [];
|
||||||
|
const pages = chunk(inCategory, site.postsPerPage);
|
||||||
|
return pages.map((items, i) => ({
|
||||||
|
params: { category: category.slug, page: pageParam(i + 1) },
|
||||||
|
props: { category, items, allPosts: posts, current: i + 1, total: pages.length },
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
}) satisfies GetStaticPaths;
|
||||||
|
|
||||||
|
const { category, items, allPosts, current, total } = Astro.props;
|
||||||
|
---
|
||||||
|
|
||||||
|
<BlogListing
|
||||||
|
eyebrow={blog.list.categoryEyebrow}
|
||||||
|
title={category.name}
|
||||||
|
description={category.description || fmt(blog.list.categoryDescription, { name: category.name })}
|
||||||
|
posts={items}
|
||||||
|
allPosts={allPosts}
|
||||||
|
current={current}
|
||||||
|
total={total}
|
||||||
|
base={categoryUrl(category.slug)}
|
||||||
|
activeCategory={category.slug}
|
||||||
|
/>
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
---
|
||||||
|
import { Icon } from 'astro-icon/components';
|
||||||
|
import Card from '../components/Card.astro';
|
||||||
|
import Container from '../components/Container.astro';
|
||||||
|
import PageHeader from '../components/PageHeader.astro';
|
||||||
|
import BaseLayout from '../layouts/BaseLayout.astro';
|
||||||
|
import { about, site } from '../lib/data';
|
||||||
|
|
||||||
|
const jsonLd = [
|
||||||
|
{
|
||||||
|
'@type': 'ProfilePage',
|
||||||
|
'@id': `${site.url}/hakkimda/#page`,
|
||||||
|
url: `${site.url}/hakkimda/`,
|
||||||
|
name: about.seo.title,
|
||||||
|
inLanguage: site.lang,
|
||||||
|
mainEntity: { '@id': `${site.url}/#person` },
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const sectionTitle =
|
||||||
|
'font-display flex items-center gap-3 text-sm font-bold tracking-wide uppercase';
|
||||||
|
---
|
||||||
|
|
||||||
|
<BaseLayout title={about.seo.title} description={about.seo.description} jsonLd={jsonLd}>
|
||||||
|
<PageHeader eyebrow={about.eyebrow} title={about.title} lead={about.lead} />
|
||||||
|
|
||||||
|
<Container class="flex flex-col gap-14 py-14 md:py-20">
|
||||||
|
<section aria-labelledby="identity-title">
|
||||||
|
<h2 id="identity-title" class={sectionTitle}>
|
||||||
|
{about.identity.title}
|
||||||
|
<span aria-hidden="true" class="bg-accent h-0.5 w-12"></span>
|
||||||
|
</h2>
|
||||||
|
<dl class="mt-6 grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
|
||||||
|
{about.identity.items.map((item) => (
|
||||||
|
<div class="bg-surface border-line flex flex-col gap-2 border p-5">
|
||||||
|
<dt class="text-fg-muted flex items-center gap-2 text-sm font-semibold">
|
||||||
|
<Icon name={item.icon} class="text-accent-text size-5" aria-hidden="true" />
|
||||||
|
{item.label}
|
||||||
|
</dt>
|
||||||
|
<dd class="font-display text-2xl leading-tight font-black">{item.value}</dd>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</dl>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div class="grid gap-6 lg:grid-cols-3">
|
||||||
|
{about.equipment.map((group, gi) => (
|
||||||
|
<Card as="section" aria-labelledby={`equipment-${gi}`} class="p-6">
|
||||||
|
<h2 id={`equipment-${gi}`} class="flex items-center gap-3 text-xl font-bold">
|
||||||
|
<Icon name={group.icon} class="text-accent-text size-7" aria-hidden="true" />
|
||||||
|
{group.title}
|
||||||
|
</h2>
|
||||||
|
<ul class="mt-5 flex flex-col">
|
||||||
|
{group.items.map((item) => (
|
||||||
|
<li class="border-line flex items-baseline justify-between gap-3 border-b py-3 last:border-b-0">
|
||||||
|
<span class="font-semibold">{item.name}</span>
|
||||||
|
{item.note && <span class="text-fg-muted text-right text-sm">{item.note}</span>}
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
</Card>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</Container>
|
||||||
|
</BaseLayout>
|
||||||
@@ -0,0 +1,149 @@
|
|||||||
|
---
|
||||||
|
// Static import: inlined on this page only (a dynamic CSS import breaks with inlineStylesheets).
|
||||||
|
import 'leaflet/dist/leaflet.css';
|
||||||
|
import { Icon } from 'astro-icon/components';
|
||||||
|
import Container from '../components/Container.astro';
|
||||||
|
import ExternalLink from '../components/ExternalLink.astro';
|
||||||
|
import PageHeader from '../components/PageHeader.astro';
|
||||||
|
import BaseLayout from '../layouts/BaseLayout.astro';
|
||||||
|
import { contact, site } from '../lib/data';
|
||||||
|
|
||||||
|
const { map } = contact;
|
||||||
|
const jsonLd = [
|
||||||
|
{
|
||||||
|
'@type': 'ContactPage',
|
||||||
|
url: `${site.url}/iletisim/`,
|
||||||
|
name: contact.seo.title,
|
||||||
|
inLanguage: site.lang,
|
||||||
|
about: { '@id': `${site.url}/#person` },
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const sectionTitle =
|
||||||
|
'font-display flex items-center gap-3 text-sm font-bold tracking-wide uppercase';
|
||||||
|
---
|
||||||
|
|
||||||
|
<BaseLayout title={contact.seo.title} description={contact.seo.description} jsonLd={jsonLd}>
|
||||||
|
<PageHeader
|
||||||
|
eyebrow={contact.eyebrow}
|
||||||
|
title={contact.title}
|
||||||
|
lead={contact.lead}
|
||||||
|
icon={contact.icon}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Container class="grid gap-12 py-14 md:py-20 lg:grid-cols-[minmax(0,5fr)_minmax(0,7fr)]">
|
||||||
|
<section aria-labelledby="info-title">
|
||||||
|
<h2 id="info-title" class={sectionTitle}>
|
||||||
|
{contact.infoTitle}
|
||||||
|
<span aria-hidden="true" class="bg-accent h-0.5 w-12"></span>
|
||||||
|
</h2>
|
||||||
|
<dl class="mt-6 flex flex-col">
|
||||||
|
{contact.items.map((item) => {
|
||||||
|
const [user, domain] = item.email?.split('@') ?? [];
|
||||||
|
return (
|
||||||
|
<div class="border-line grid grid-cols-[2rem_minmax(0,1fr)] gap-x-3 gap-y-1 border-b py-4">
|
||||||
|
<dt class="font-display col-start-2 text-sm font-bold tracking-wide uppercase">
|
||||||
|
{item.label}
|
||||||
|
</dt>
|
||||||
|
<dd class="col-start-1 row-span-2 row-start-1">
|
||||||
|
<Icon name={item.icon} class="text-accent-text size-7" aria-hidden="true" />
|
||||||
|
</dd>
|
||||||
|
<dd class="col-start-2">
|
||||||
|
{item.email ? (
|
||||||
|
<span data-email data-u={user} data-d={domain} class="font-semibold">
|
||||||
|
{user} [at] {domain}
|
||||||
|
</span>
|
||||||
|
) : item.href ? (
|
||||||
|
<ExternalLink
|
||||||
|
href={item.href}
|
||||||
|
class="decoration-accent font-semibold underline underline-offset-4"
|
||||||
|
>
|
||||||
|
{item.values?.[0] ?? item.href}
|
||||||
|
</ExternalLink>
|
||||||
|
) : (
|
||||||
|
<ul class="flex flex-col gap-0.5">
|
||||||
|
{item.values?.map((v) => (
|
||||||
|
<li>{v}</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</dl>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section aria-labelledby="map-title" class="flex flex-col gap-4">
|
||||||
|
<h2 id="map-title" class={sectionTitle}>
|
||||||
|
{map.title}
|
||||||
|
<span aria-hidden="true" class="bg-accent h-0.5 w-12"></span>
|
||||||
|
</h2>
|
||||||
|
<div
|
||||||
|
id="map"
|
||||||
|
role="region"
|
||||||
|
aria-label={map.ariaLabel}
|
||||||
|
data-lat={map.lat}
|
||||||
|
data-lng={map.lng}
|
||||||
|
data-zoom={map.zoom}
|
||||||
|
data-popup={map.popup}
|
||||||
|
class="border-line bg-bg-alt relative z-0 h-[26rem] w-full border"
|
||||||
|
>
|
||||||
|
<p
|
||||||
|
class="text-fg-muted absolute inset-0 flex items-center justify-center text-sm"
|
||||||
|
data-map-loading
|
||||||
|
>
|
||||||
|
{map.loading}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<p class="text-fg-muted text-sm">{map.note}</p>
|
||||||
|
<template id="tower-icon">
|
||||||
|
<Icon name="tabler:building-broadcast-tower" class="size-6" aria-hidden="true" />
|
||||||
|
</template>
|
||||||
|
</section>
|
||||||
|
</Container>
|
||||||
|
</BaseLayout>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// De-obfuscate e-mail addresses (kept out of the HTML for simple bots).
|
||||||
|
for (const el of document.querySelectorAll<HTMLElement>('[data-email]')) {
|
||||||
|
const address = `${el.dataset.u}@${el.dataset.d}`;
|
||||||
|
const a = document.createElement('a');
|
||||||
|
a.href = `mailto:${address}`;
|
||||||
|
a.textContent = address;
|
||||||
|
a.className = 'decoration-accent font-semibold underline underline-offset-4';
|
||||||
|
el.replaceWith(a);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Leaflet + OSM, loaded only when the map scrolls into view.
|
||||||
|
const el = document.getElementById('map');
|
||||||
|
if (el) {
|
||||||
|
const init = async () => {
|
||||||
|
const { default: L } = await import('leaflet');
|
||||||
|
const { lat, lng, zoom, popup = '' } = el.dataset;
|
||||||
|
const center: [number, number] = [Number(lat), Number(lng)];
|
||||||
|
el.querySelector('[data-map-loading]')?.remove();
|
||||||
|
const m = L.map(el, { scrollWheelZoom: false }).setView(center, Number(zoom));
|
||||||
|
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||||
|
maxZoom: 19,
|
||||||
|
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',
|
||||||
|
}).addTo(m);
|
||||||
|
const icon = L.divIcon({
|
||||||
|
html: `<span class="tower-pin">${(document.getElementById('tower-icon') as HTMLTemplateElement).innerHTML}</span>`,
|
||||||
|
className: 'tower-marker',
|
||||||
|
iconSize: [40, 40],
|
||||||
|
iconAnchor: [20, 48], // tip of the rotated pin
|
||||||
|
popupAnchor: [0, -46],
|
||||||
|
});
|
||||||
|
L.marker(center, { icon, title: popup, alt: popup }).addTo(m).bindPopup(popup);
|
||||||
|
};
|
||||||
|
new IntersectionObserver(
|
||||||
|
(entries, obs) => {
|
||||||
|
if (entries.some((e) => e.isIntersecting)) {
|
||||||
|
obs.disconnect();
|
||||||
|
void init();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ rootMargin: '200px' },
|
||||||
|
).observe(el);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -1,16 +1,46 @@
|
|||||||
---
|
---
|
||||||
|
import CardGrid from '../components/home/CardGrid.astro';
|
||||||
|
import FeatureSection from '../components/home/FeatureSection.astro';
|
||||||
|
import Hero from '../components/home/Hero.astro';
|
||||||
|
import LatestPosts from '../components/home/LatestPosts.astro';
|
||||||
|
import PostCard from '../components/blog/PostCard.astro';
|
||||||
|
import BaseLayout from '../layouts/BaseLayout.astro';
|
||||||
|
import { home } from '../lib/data';
|
||||||
|
import { getPosts } from '../lib/posts';
|
||||||
|
|
||||||
|
const posts = await getPosts();
|
||||||
|
|
||||||
|
// Hero is khaki, so sections alternate paper → khaki → … after it.
|
||||||
|
let featureIndex = 0;
|
||||||
|
const sections = home.sections.map((section, i) => ({
|
||||||
|
section,
|
||||||
|
alt: i % 2 === 1,
|
||||||
|
index: section.type === 'feature' ? ++featureIndex : 0,
|
||||||
|
}));
|
||||||
---
|
---
|
||||||
|
|
||||||
<html lang="en">
|
<BaseLayout description={home.seo.description}>
|
||||||
<head>
|
<Hero />
|
||||||
<meta charset="utf-8" />
|
{sections.map(({ section, alt, index }) => {
|
||||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
switch (section.type) {
|
||||||
<link rel="icon" href="/favicon.ico" />
|
case 'feature':
|
||||||
<meta name="viewport" content="width=device-width" />
|
return <FeatureSection section={section} index={index} alt={alt} />;
|
||||||
<meta name="generator" content={Astro.generator} />
|
case 'cards':
|
||||||
<title>Astro</title>
|
return <CardGrid section={section} alt={alt} />;
|
||||||
</head>
|
case 'latestPosts': {
|
||||||
<body>
|
const latest = posts.slice(0, section.count);
|
||||||
<h1>Astro</h1>
|
return (
|
||||||
</body>
|
<LatestPosts section={section} alt={alt} hasPosts={latest.length > 0}>
|
||||||
</html>
|
<ul class="grid gap-6 md:grid-cols-2 lg:grid-cols-3">
|
||||||
|
{latest.map((post) => (
|
||||||
|
<li class="flex">
|
||||||
|
<PostCard post={post} layout="stack" headingLevel={3} />
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
</LatestPosts>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})}
|
||||||
|
</BaseLayout>
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import type { APIRoute } from 'astro';
|
||||||
|
import { home } from '../lib/data';
|
||||||
|
import { renderOg } from '../lib/og';
|
||||||
|
|
||||||
|
// /og-default.png — share image for pages without their own.
|
||||||
|
export const GET: APIRoute = async () => {
|
||||||
|
const png = await renderOg({ title: home.hero.title });
|
||||||
|
return new Response(new Uint8Array(png), { headers: { 'Content-Type': 'image/png' } });
|
||||||
|
};
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import type { APIRoute, GetStaticPaths } from 'astro';
|
||||||
|
import { renderOg } from '../../lib/og';
|
||||||
|
import { categoryOf, getPosts, type Post } from '../../lib/posts';
|
||||||
|
|
||||||
|
// /og/<slug>.png — per-post share image, generated at build time.
|
||||||
|
export const getStaticPaths = (async () => {
|
||||||
|
const posts = await getPosts();
|
||||||
|
return posts.map((post) => ({ params: { slug: post.id }, props: { post } }));
|
||||||
|
}) satisfies GetStaticPaths;
|
||||||
|
|
||||||
|
export const GET: APIRoute<{ post: Post }> = async ({ props }) => {
|
||||||
|
const png = await renderOg({
|
||||||
|
title: props.post.data.title,
|
||||||
|
eyebrow: categoryOf(props.post).name,
|
||||||
|
});
|
||||||
|
return new Response(new Uint8Array(png), { headers: { 'Content-Type': 'image/png' } });
|
||||||
|
};
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
import type { APIRoute } from 'astro';
|
||||||
|
import { site } from '../lib/data';
|
||||||
|
|
||||||
|
export const GET: APIRoute = () =>
|
||||||
|
new Response(
|
||||||
|
[
|
||||||
|
'User-agent: *',
|
||||||
|
'Allow: /',
|
||||||
|
'Disallow: /api/',
|
||||||
|
'',
|
||||||
|
`Sitemap: ${site.url}/sitemap-index.xml`,
|
||||||
|
'',
|
||||||
|
].join('\n'),
|
||||||
|
{ headers: { 'Content-Type': 'text/plain; charset=utf-8' } },
|
||||||
|
);
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import rss from '@astrojs/rss';
|
||||||
|
import type { APIContext } from 'astro';
|
||||||
|
import { site } from '../lib/data';
|
||||||
|
import { categoryOf, getPosts, postUrl } from '../lib/posts';
|
||||||
|
|
||||||
|
export async function GET(context: APIContext) {
|
||||||
|
const posts = await getPosts();
|
||||||
|
return rss({
|
||||||
|
title: site.title,
|
||||||
|
description: site.description,
|
||||||
|
site: context.site ?? site.url,
|
||||||
|
trailingSlash: true,
|
||||||
|
items: posts.map((post) => ({
|
||||||
|
title: post.data.title,
|
||||||
|
description: post.data.description,
|
||||||
|
pubDate: post.data.pubDate,
|
||||||
|
link: postUrl(post),
|
||||||
|
categories: [categoryOf(post).name, ...post.data.tags],
|
||||||
|
})),
|
||||||
|
customData: `<language>${site.lang}</language>`,
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import type { APIRoute } from 'astro';
|
||||||
|
import { site } from '../lib/data';
|
||||||
|
|
||||||
|
export const GET: APIRoute = () =>
|
||||||
|
Response.json(
|
||||||
|
{
|
||||||
|
name: site.title,
|
||||||
|
short_name: site.name,
|
||||||
|
description: site.description,
|
||||||
|
lang: site.lang,
|
||||||
|
start_url: '/',
|
||||||
|
display: 'minimal-ui',
|
||||||
|
background_color: '#f2efee',
|
||||||
|
theme_color: '#d5d09b',
|
||||||
|
icons: [
|
||||||
|
{ src: '/icon-192.png', sizes: '192x192', type: 'image/png' },
|
||||||
|
{ src: '/icon-512.png', sizes: '512x512', type: 'image/png' },
|
||||||
|
{ src: '/icon-maskable-512.png', sizes: '512x512', type: 'image/png', purpose: 'maskable' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{ headers: { 'Content-Type': 'application/manifest+json' } },
|
||||||
|
);
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
/* Generated by scripts/subset-fonts.mjs — do not edit. Fonts: SIL OFL 1.1 (Rubik, Inter). */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Rubik Variable';
|
||||||
|
font-style: normal;
|
||||||
|
font-display: swap;
|
||||||
|
font-weight: 400 900;
|
||||||
|
src: url('/fonts/rubik-latin.woff2') format('woff2-variations');
|
||||||
|
unicode-range:
|
||||||
|
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
|
||||||
|
U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Rubik Variable';
|
||||||
|
font-style: normal;
|
||||||
|
font-display: swap;
|
||||||
|
font-weight: 400 900;
|
||||||
|
src: url('/fonts/rubik-latin-ext.woff2') format('woff2-variations');
|
||||||
|
unicode-range:
|
||||||
|
U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
|
||||||
|
U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
|
||||||
|
U+A720-A7FF;
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter Variable';
|
||||||
|
font-style: normal;
|
||||||
|
font-display: swap;
|
||||||
|
font-weight: 400 700;
|
||||||
|
src: url('/fonts/inter-latin.woff2') format('woff2-variations');
|
||||||
|
unicode-range:
|
||||||
|
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
|
||||||
|
U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter Variable';
|
||||||
|
font-style: normal;
|
||||||
|
font-display: swap;
|
||||||
|
font-weight: 400 700;
|
||||||
|
src: url('/fonts/inter-latin-ext.woff2') format('woff2-variations');
|
||||||
|
unicode-range:
|
||||||
|
U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
|
||||||
|
U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
|
||||||
|
U+A720-A7FF;
|
||||||
|
}
|
||||||
@@ -0,0 +1,268 @@
|
|||||||
|
@import 'tailwindcss';
|
||||||
|
@import './fonts.css'; /* generated: npm run fonts */
|
||||||
|
@plugin '@tailwindcss/typography';
|
||||||
|
|
||||||
|
@custom-variant dark (&:where([data-theme=dark], [data-theme=dark] *));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Palette: Huemint "Magazine" — #f2efee #d5d09b #111012 #c95748
|
||||||
|
* Contrast notes (WCAG): ink on red = 4.46 → only large/bold text (≥19px bold) on --accent.
|
||||||
|
* Small text on a red fill uses --accent-fill + --on-accent-fill (5.3 light / 6.5 dark).
|
||||||
|
* Small red text uses --accent-text, which falls back to --fg on khaki sections (red/khaki < 4.5).
|
||||||
|
*/
|
||||||
|
:root {
|
||||||
|
color-scheme: light;
|
||||||
|
--bg: #f2efee;
|
||||||
|
--bg-alt: #d5d09b;
|
||||||
|
--surface: #f8f6f5;
|
||||||
|
--fg: #111012;
|
||||||
|
--fg-muted: #4a474b;
|
||||||
|
--line: color-mix(in oklab, #111012 18%, transparent);
|
||||||
|
--accent: #c95748;
|
||||||
|
--accent-strong: #a8412f;
|
||||||
|
--on-accent: #111012;
|
||||||
|
--accent-fill: #a8412f;
|
||||||
|
--on-accent-fill: #f2efee;
|
||||||
|
--accent-on-alt: var(--fg);
|
||||||
|
--accent-text: var(--accent-strong);
|
||||||
|
}
|
||||||
|
|
||||||
|
[data-theme='dark'] {
|
||||||
|
color-scheme: dark;
|
||||||
|
--bg: #111012;
|
||||||
|
--bg-alt: #1c1b17;
|
||||||
|
--surface: #19181a;
|
||||||
|
--fg: #ebe7e4;
|
||||||
|
--fg-muted: #b3ad8a;
|
||||||
|
--line: color-mix(in oklab, #d5d09b 16%, transparent);
|
||||||
|
--accent: #e07a6b;
|
||||||
|
--accent-strong: #e07a6b;
|
||||||
|
--on-accent: #111012;
|
||||||
|
--accent-fill: #e07a6b;
|
||||||
|
--on-accent-fill: #111012;
|
||||||
|
--accent-on-alt: var(--accent);
|
||||||
|
--accent-text: var(--accent-strong);
|
||||||
|
}
|
||||||
|
|
||||||
|
@theme inline {
|
||||||
|
--color-bg: var(--bg);
|
||||||
|
--color-bg-alt: var(--bg-alt);
|
||||||
|
--color-surface: var(--surface);
|
||||||
|
--color-fg: var(--fg);
|
||||||
|
--color-fg-muted: var(--fg-muted);
|
||||||
|
--color-line: var(--line);
|
||||||
|
--color-accent: var(--accent);
|
||||||
|
--color-accent-strong: var(--accent-strong);
|
||||||
|
--color-accent-text: var(--accent-text);
|
||||||
|
--color-accent-fill: var(--accent-fill);
|
||||||
|
--color-on-accent: var(--on-accent);
|
||||||
|
--color-on-accent-fill: var(--on-accent-fill);
|
||||||
|
--color-khaki: #d5d09b;
|
||||||
|
--color-paper: #f2efee;
|
||||||
|
--color-ink: #111012;
|
||||||
|
--font-display: 'Rubik Variable', ui-sans-serif, system-ui, sans-serif;
|
||||||
|
--font-sans: 'Inter Variable', ui-sans-serif, system-ui, sans-serif;
|
||||||
|
--font-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
|
||||||
|
}
|
||||||
|
|
||||||
|
@layer base {
|
||||||
|
html {
|
||||||
|
@apply bg-bg font-sans text-fg antialiased;
|
||||||
|
scroll-padding-top: 5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
@apply min-h-dvh text-[1.0625rem] leading-relaxed;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1,
|
||||||
|
h2,
|
||||||
|
h3,
|
||||||
|
h4 {
|
||||||
|
@apply font-display;
|
||||||
|
}
|
||||||
|
|
||||||
|
:focus-visible {
|
||||||
|
@apply outline-3 outline-offset-2 outline-accent;
|
||||||
|
}
|
||||||
|
|
||||||
|
::selection {
|
||||||
|
@apply bg-accent text-on-accent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@layer components {
|
||||||
|
/* Khaki (alt) section: switches small red text to an accessible colour. */
|
||||||
|
.surface-alt {
|
||||||
|
@apply bg-bg-alt;
|
||||||
|
--accent-text: var(--accent-on-alt);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Magazine headline: heavy, uppercase, tight. */
|
||||||
|
.headline {
|
||||||
|
@apply font-display leading-[0.95] font-black tracking-tight uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* "Learn More" style link: thick underline that turns red on hover. */
|
||||||
|
.link-strong {
|
||||||
|
@apply font-display font-bold underline decoration-fg decoration-3 underline-offset-[0.35em] transition-colors hover:decoration-accent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
*,
|
||||||
|
*::before,
|
||||||
|
*::after {
|
||||||
|
animation-duration: 0.01ms !important;
|
||||||
|
animation-iteration-count: 1 !important;
|
||||||
|
transition-duration: 0.01ms !important;
|
||||||
|
scroll-behavior: auto !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---------- Article typography (unlayered: overrides the typography plugin) ---------- */
|
||||||
|
.article-prose {
|
||||||
|
--tw-prose-body: var(--fg);
|
||||||
|
--tw-prose-headings: var(--fg);
|
||||||
|
--tw-prose-lead: var(--fg-muted);
|
||||||
|
--tw-prose-links: var(--accent-strong);
|
||||||
|
--tw-prose-bold: var(--fg);
|
||||||
|
--tw-prose-counters: var(--fg-muted);
|
||||||
|
--tw-prose-bullets: var(--accent);
|
||||||
|
--tw-prose-hr: var(--line);
|
||||||
|
--tw-prose-quotes: var(--fg);
|
||||||
|
--tw-prose-quote-borders: var(--accent);
|
||||||
|
--tw-prose-captions: var(--fg-muted);
|
||||||
|
--tw-prose-kbd: var(--fg);
|
||||||
|
--tw-prose-code: var(--fg);
|
||||||
|
--tw-prose-pre-code: var(--fg);
|
||||||
|
--tw-prose-pre-bg: var(--surface);
|
||||||
|
--tw-prose-th-borders: var(--fg);
|
||||||
|
--tw-prose-td-borders: var(--line);
|
||||||
|
}
|
||||||
|
|
||||||
|
.article-prose :where(h2, h3, h4) {
|
||||||
|
font-family: var(--font-display);
|
||||||
|
font-weight: 800;
|
||||||
|
scroll-margin-top: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.article-prose :where(a) {
|
||||||
|
text-decoration-thickness: 2px;
|
||||||
|
text-underline-offset: 0.2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.article-prose :where(:not(pre) > code) {
|
||||||
|
background: var(--bg-alt);
|
||||||
|
padding: 0.1em 0.35em;
|
||||||
|
border-radius: 2px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
.article-prose :where(:not(pre) > code)::before,
|
||||||
|
.article-prose :where(:not(pre) > code)::after {
|
||||||
|
content: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.article-prose :where(blockquote) {
|
||||||
|
font-style: normal;
|
||||||
|
background: var(--surface);
|
||||||
|
padding-block: 0.25em;
|
||||||
|
}
|
||||||
|
.article-prose :where(blockquote p)::before,
|
||||||
|
.article-prose :where(blockquote p)::after {
|
||||||
|
content: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.article-prose :where(figure) {
|
||||||
|
margin-inline: 0;
|
||||||
|
}
|
||||||
|
.article-prose :where(figcaption) {
|
||||||
|
border-left: 3px solid var(--accent);
|
||||||
|
padding-left: 0.75em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Shiki dual theme (defaultColor: false) */
|
||||||
|
.astro-code {
|
||||||
|
color: var(--shiki-light);
|
||||||
|
background-color: var(--surface) !important;
|
||||||
|
border: 1px solid var(--line);
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
.astro-code span {
|
||||||
|
color: var(--shiki-light);
|
||||||
|
}
|
||||||
|
[data-theme='dark'] .astro-code,
|
||||||
|
[data-theme='dark'] .astro-code span {
|
||||||
|
color: var(--shiki-dark);
|
||||||
|
}
|
||||||
|
|
||||||
|
.code-block {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
/* Room for the copy button so it never covers the first line. */
|
||||||
|
.code-block > pre {
|
||||||
|
padding-top: 2.5rem;
|
||||||
|
}
|
||||||
|
.code-copy {
|
||||||
|
position: absolute;
|
||||||
|
top: 0.5rem;
|
||||||
|
right: 0.5rem;
|
||||||
|
padding: 0.15rem 0.6rem;
|
||||||
|
font: 700 0.75rem/1.5 var(--font-display);
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 0.04em;
|
||||||
|
color: var(--bg);
|
||||||
|
background: var(--fg);
|
||||||
|
border-radius: 2px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.code-copy:hover {
|
||||||
|
background: var(--accent-fill);
|
||||||
|
color: var(--on-accent-fill);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---------- Contact map (Leaflet) ---------- */
|
||||||
|
.tower-marker {
|
||||||
|
background: none;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
/* Rotate an inner element: `rotate` on the marker itself would also rotate Leaflet's translate3d. */
|
||||||
|
.tower-pin {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background: var(--accent-fill);
|
||||||
|
color: var(--on-accent-fill);
|
||||||
|
border: 2px solid var(--fg);
|
||||||
|
border-radius: 50% 50% 50% 0;
|
||||||
|
rotate: -45deg;
|
||||||
|
}
|
||||||
|
.tower-pin svg {
|
||||||
|
rotate: 45deg;
|
||||||
|
}
|
||||||
|
.leaflet-container .leaflet-control-attribution {
|
||||||
|
background: var(--surface);
|
||||||
|
color: var(--fg);
|
||||||
|
}
|
||||||
|
.leaflet-container .leaflet-control-attribution a {
|
||||||
|
color: var(--accent-strong);
|
||||||
|
}
|
||||||
|
.leaflet-container {
|
||||||
|
font: inherit;
|
||||||
|
background: var(--bg-alt);
|
||||||
|
}
|
||||||
|
.leaflet-popup-content {
|
||||||
|
font-family: var(--font-display);
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
/* Dark tiles without a second tile provider. */
|
||||||
|
[data-theme='dark'] .leaflet-tile-pane {
|
||||||
|
filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9);
|
||||||
|
}
|
||||||
|
.leaflet-container .leaflet-popup-content-wrapper,
|
||||||
|
.leaflet-container .leaflet-popup-tip {
|
||||||
|
background: var(--surface);
|
||||||
|
color: var(--fg);
|
||||||
|
}
|
||||||