format all code (#386)

This commit is contained in:
Katsuyuki Karasawa authored and GitHub committed 2025-04-08 23:08:31 +09:00
1 parent 7ea2f7f40f
commit 286b050fa8
61 files changed
+1329 -1307

No files matched your search

+14 -14
View File
@@ -1,25 +1,25 @@
---
import WidgetLayout from './WidgetLayout.astro'
import WidgetLayout from "./WidgetLayout.astro";
import { i18n } from '../../i18n/translation'
import I18nKey from '../../i18n/i18nKey'
import { getCategoryList } from '../../utils/content-utils'
import { getCategoryUrl } from '../../utils/url-utils'
import ButtonLink from '../control/ButtonLink.astro'
import I18nKey from "../../i18n/i18nKey";
import { i18n } from "../../i18n/translation";
import { getCategoryList } from "../../utils/content-utils";
import { getCategoryUrl } from "../../utils/url-utils";
import ButtonLink from "../control/ButtonLink.astro";
const categories = await getCategoryList()
const categories = await getCategoryList();
const COLLAPSED_HEIGHT = '7.5rem'
const COLLAPSE_THRESHOLD = 5
const COLLAPSED_HEIGHT = "7.5rem";
const COLLAPSE_THRESHOLD = 5;
const isCollapsed = categories.length >= COLLAPSE_THRESHOLD
const isCollapsed = categories.length >= COLLAPSE_THRESHOLD;
interface Props {
class?: string
style?: string
class?: string;
style?: string;
}
const className = Astro.props.class
const style = Astro.props.style
const className = Astro.props.class;
const style = Astro.props.style;
---
<WidgetLayout name={i18n(I18nKey.categories)} id="categories" isCollapsed={isCollapsed} collapsedHeight={COLLAPSED_HEIGHT}
+8 -8
View File
@@ -1,18 +1,18 @@
<script lang="ts">
import { i18n } from '@i18n/translation'
import I18nKey from '@i18n/i18nKey'
import { getDefaultHue, getHue, setHue } from '@utils/setting-utils'
import Icon from '@iconify/svelte'
import I18nKey from "@i18n/i18nKey";
import { i18n } from "@i18n/translation";
import Icon from "@iconify/svelte";
import { getDefaultHue, getHue, setHue } from "@utils/setting-utils";
let hue = getHue()
const defaultHue = getDefaultHue()
let hue = getHue();
const defaultHue = getDefaultHue();
function resetHue() {
hue = getDefaultHue()
hue = getDefaultHue();
}
$: if (hue || hue === 0) {
setHue(hue)
setHue(hue);
}
</script>
+5 -5
View File
@@ -1,13 +1,13 @@
---
import { type NavBarLink } from '../../types/config'
import { Icon } from 'astro-icon/components'
import { url } from '../../utils/url-utils'
import { Icon } from "astro-icon/components";
import { type NavBarLink } from "../../types/config";
import { url } from "../../utils/url-utils";
interface Props {
links: NavBarLink[]
links: NavBarLink[];
}
const links = Astro.props.links
const links = Astro.props.links;
---
<div id="nav-menu-panel" class:list={["float-panel float-panel-closed absolute transition-all fixed right-4 px-2 py-2"]}>
{links.map((link) => (
+5 -5
View File
@@ -1,10 +1,10 @@
---
import ImageWrapper from '../misc/ImageWrapper.astro'
import { Icon } from 'astro-icon/components'
import { profileConfig } from '../../config'
import { url } from '../../utils/url-utils'
import { Icon } from "astro-icon/components";
import { profileConfig } from "../../config";
import { url } from "../../utils/url-utils";
import ImageWrapper from "../misc/ImageWrapper.astro";
const config = profileConfig
const config = profileConfig;
---
<div class="card-base p-3">
<a aria-label="Go to About Page" href={url('/about/')}
+7 -8
View File
@@ -1,16 +1,15 @@
---
import Profile from './Profile.astro'
import Tag from './Tags.astro'
import Categories from './Categories.astro'
import type { MarkdownHeading } from 'astro'
import type { MarkdownHeading } from "astro";
import Categories from "./Categories.astro";
import Profile from "./Profile.astro";
import Tag from "./Tags.astro";
interface Props {
class? : string
headings? : MarkdownHeading[]
class?: string;
headings?: MarkdownHeading[];
}
const className = Astro.props.class
const className = Astro.props.class;
---
<div id="sidebar" class:list={[className, "w-full"]}>
<div class="flex flex-col w-full gap-4 mb-4">
+12 -12
View File
@@ -1,29 +1,29 @@
---
import type { MarkdownHeading } from 'astro';
import type { MarkdownHeading } from "astro";
import { siteConfig } from "../../config";
interface Props {
class?: string
headings: MarkdownHeading[]
class?: string;
headings: MarkdownHeading[];
}
let { headings = [] } = Astro.props;
let { headings = [] } = Astro.props;
let minDepth = 10;
for (const heading of headings) {
minDepth = Math.min(minDepth, heading.depth);
minDepth = Math.min(minDepth, heading.depth);
}
const className = Astro.props.class
const className = Astro.props.class;
const removeTailingHash = (text: string) => {
let lastIndexOfHash = text.lastIndexOf('#');
if (lastIndexOfHash !== text.length - 1) {
return text;
}
let lastIndexOfHash = text.lastIndexOf("#");
if (lastIndexOfHash !== text.length - 1) {
return text;
}
return text.substring(0, lastIndexOfHash);
}
return text.substring(0, lastIndexOfHash);
};
let heading1Count = 1;
+13 -13
View File
@@ -1,24 +1,24 @@
---
import WidgetLayout from './WidgetLayout.astro'
import ButtonTag from '../control/ButtonTag.astro'
import { getTagList } from '../../utils/content-utils'
import { i18n } from '../../i18n/translation'
import I18nKey from '../../i18n/i18nKey'
import { url } from '../../utils/url-utils'
import I18nKey from "../../i18n/i18nKey";
import { i18n } from "../../i18n/translation";
import { getTagList } from "../../utils/content-utils";
import { url } from "../../utils/url-utils";
import ButtonTag from "../control/ButtonTag.astro";
import WidgetLayout from "./WidgetLayout.astro";
const tags = await getTagList()
const tags = await getTagList();
const COLLAPSED_HEIGHT = '7.5rem'
const COLLAPSED_HEIGHT = "7.5rem";
const isCollapsed = tags.length >= 20
const isCollapsed = tags.length >= 20;
interface Props {
class?: string
style?: string
class?: string;
style?: string;
}
const className = Astro.props.class
const style = Astro.props.style
const className = Astro.props.class;
const style = Astro.props.style;
---
<WidgetLayout name={i18n(I18nKey.tags)} id="tags" isCollapsed={isCollapsed} collapsedHeight={COLLAPSED_HEIGHT} class={className} style={style}>
<div class="flex gap-2 flex-wrap">
+11 -11
View File
@@ -1,17 +1,17 @@
---
import { Icon } from 'astro-icon/components'
import { i18n } from '../../i18n/translation'
import I18nKey from '../../i18n/i18nKey'
import { Icon } from "astro-icon/components";
import I18nKey from "../../i18n/i18nKey";
import { i18n } from "../../i18n/translation";
interface Props {
id: string
name?: string
isCollapsed?: boolean
collapsedHeight?: string
class?: string
style?: string
id: string;
name?: string;
isCollapsed?: boolean;
collapsedHeight?: string;
class?: string;
style?: string;
}
const { id, name, isCollapsed, collapsedHeight, style } = Astro.props
const className = Astro.props.class
const { id, name, isCollapsed, collapsedHeight, style } = Astro.props;
const className = Astro.props.class;
---
<widget-layout data-id={id} data-is-collapsed={String(isCollapsed)} class={"pb-4 card-base " + className} style={style}>
<div class="font-bold transition text-lg text-neutral-900 dark:text-neutral-100 relative ml-8 mt-4 mb-2